Scotty
Posts: 20
|
| Posted: 04/25/2005, 4:16 PM |
|
Hi,
Using Windows XP Pro and IIS with PHP and MySQL.
I'm getting the following error:
The value in field urlUserID is not valid. (56#user)
Warning: Cannot modify header information - headers already sent by (output started at
c:\inetpub\wwwroot\tcmv31\Classes.php:377) in
c:\inetpub\wwwroot\tcmv31\useradmin.php on line 1963
Database error: Invalid SQL: SELECT COUNT(*)
FROM Contracts_Access
INNER JOIN Contracts_Contracts
ON Contracts_Access.ProjectID = Contracts_Contracts.ProjectID
WHERE Contracts_Access.UserID = AND Contracts_Contracts.CompanyID = 1
MySQL Error: 1064 (You have an error in your SQL syntax.
Check the manual that corresponds to your MySQL server
version for the right syntax to use near 'AND
Contracts_Contracts.CompanyID = 1' at line 1)
Session halted.
I've read some posts that have a similar problem with not being able to "modify header information". They have suggested modifying the "session.save_path" variable. However, I'm not sure if this is the right solution for my problem. At the moment, I've got the following setting (around line 827 in the php.ini):
session.save_path = C:/temp
I'm not sure if this is the correct setting, or even if it relates to my problem.
Thanks in advance.
Scott.
|
 |
 |
mamboBROWN
Posts: 1713
|
| Posted: 04/25/2005, 7:44 PM |
|
WHERE Contracts_Access.UserID = AND Contracts_Contracts.CompanyID = 1
Looks like your missing information in your WHERE statement with the first condition "Contracts_Access.UserID=" (There should be a value here) "AND Contracts_Contracts.CompanyID = 1".
|
 |
 |
Scotty
Posts: 20
|
| Posted: 04/26/2005, 1:36 AM |
|
Hi mamboBROWN,
Yeah that is the problem which causes the error message to be displayed, but it is the urlUserID field that isn't being populated (which then feeds into the SQL statement) which is the problem. As this is all generated code, I suspect that it might be a setup problem. The SQL statement in question, is one internally created by CodeCharge and isn't part of a SELECT statement I have coded for a search or listbox select etc.
Thanks, Scott.
|
 |
 |
Nicole
Posts: 586
|
| Posted: 04/26/2005, 2:09 AM |
|
Scott,
The error is related to a value you want to use in WHERE
WHERE Contracts_Access.UserID =
If you pass UserID from URL then settings for WHERE parameter would be
Field
Name: Contracts_Access.UserID
Type: e.g. Integer
Parameter Source
Name: url parameter name, e.g. s_UserID
Type: URL
If you want to get User ID from session change Parameter Source
Name: CCGetUserID()
Type: Expression
CCGetUserID returns ID of logged in user http://docs.codecharge.com/studio/html/Components/Funct...UserID.html?toc
Note, that you need to use real names while configuring parameter settings
_________________
Regards,
Nicole |
 |
 |
Scotty
Posts: 20
|
| Posted: 05/09/2005, 1:49 PM |
|
Hi Nicole,
Sorry I didn't add this in earlier, but the function that is being performed is adding a new user. After adding a new user, the next grid is a project access (where you decide what projects a user can access).
I don't need to get the userid of the user who is logged in, but rather I need the userid of the user record that was just added.
I suspect to help me, you'll need a bit more info, but I'm not sure what is needed....
Thanks, Scott.
|
 |
 |
Nicole
Posts: 586
|
| Posted: 05/10/2005, 6:41 AM |
|
Scott,
It appears to be a 2 steps task. The first step is to retrieve last inserted user ID. The sample code for it is available in After Insert event of record form of Multi Step Registration sample (CCS Example Pack solution) http://examples.codecharge.com/ExamplePack/MultiStepReg...trationGrid.php
The second step is to add parameter to WHERE depending on a way you stored user ID retrieved on a previous step. If you stored it into a session the settings for Parameter Source are like
Name: session_varible_name
Type: Session
If you passed User ID via URL the settings are like
Name: URL_parameter_name
Type: URL
_________________
Regards,
Nicole |
 |
 |
Scotty
Posts: 20
|
| Posted: 05/10/2005, 2:31 PM |
|
Hi Nicole,
I'm starting to make some progress. I am no longer getting the SQL error message, but I am still getting the warning message:
Quote :The value in field urlUserID is not valid. (96#user)
Warning: Cannot modify header information - headers already sent by (output started at c:\inetpub\wwwroot\tcmv31\Classes.php:377) in c:\inetpub\wwwroot\tcmv31\useradmin.php on line 1963
The lines that are referred are adding to my confusion.....
In classes.php (it is the definition of function:
function GetParsedValue($ParsingValue, $Format)
and the line is
Quote :
if($this->Errors->Count() > 0)
{
if(strlen($this->ErrorBlock))
$Tpl->replaceblock($this->ErrorBlock, $this->Errors->ToString());
else
echo $this->Errors->ToString();//this is line 377
}
}
In useradmin.php
and the line is
Quote :
// Events
include("./useradmin_events.php");
BindEvents();
$CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize");
$Charset = $Charset ? $Charset : $TemplateEncoding;
if ($Charset)
header("Content-Type: text/html; charset=" . $Charset);//this is line 1963
//End Initialize Objects
Thanks, Scott.
|
 |
 |
Nicole
Posts: 586
|
| Posted: 05/11/2005, 6:40 AM |
|
Scott,
The error means that you have urlUserID value is invalid or you set incorrect Data Type for it under WHERE parameter settings.
_________________
Regards,
Nicole |
 |
 |
|