CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Getting "The value in field <variable name> is not valid" error

Print topic Send  topic

Author Message
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.
View profile  Send private message
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".

View profile  Send private message
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.
View profile  Send private message
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
View profile  Send private message
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.
View profile  Send private message
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
View profile  Send private message
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.
View profile  Send private message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.