Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Session Variable match to DB

Status
Not open for further replies.

Sitehelp

Technical User
Joined
Feb 4, 2004
Messages
142
Location
GB
Anyone know why I cannot match the clientID (which is passed in the session) with a clientID in the DB. Code is:

<?php
session_start() ;
$Client_OpenCallList = &quot;1&quot;;
if (isset($HTTP_SESSION_VARS['ClientID'])) {
$Client_OpenCallList = (get_magic_quotes_gpc()) ? $HTTP_SESSION_VARS['ClientID'] : addslashes($HTTP_SESSION_VARS['ClientID']);
}
mysql_select_db($database_MARTIN, $MARTIN);
$query_OpenCallList = sprintf(&quot;SELECT * FROM callinfo WHERE callinfo.ClientID = %s&quot;, $Client_OpenCallList);
$OpenCallList = mysql_query($query_OpenCallList, $MARTIN) or die(mysql_error());
$row_OpenCallList = mysql_fetch_assoc($OpenCallList);
$totalRows_OpenCallList = mysql_num_rows($OpenCallList);
?>

It is bringing an error message saying Unknown CLIENTID in the Where clause

Cheers!
 
the query is:

SELECT *
FROM callinfo
WHERE callinfo.ClientID = Client

Where client refers to

$_SESSION ['ClientID']

So basically when the user clicks onto the page, as they already signed into the session on a previous page, they should immiediately see all the calls they have open under there clientid name. The clientID is the username they typed in on the login page, I know this is working as it is working for other pages, but for different commands. for some reason on this page I recieve the message:

Unknown column 'THE CLIENT ID ENTERED ON LOGIN PAGE' in 'where clause'

Cheers for the help here!

 
dont ask me how but its working now, If I find the reason I will post it here! cheers anyway!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top