MySQL Forums
Forum List  »  Docs

The Session variable issue in mysql select statement
Posted by: sarfraz khan
Date: April 22, 2010 08:55PM

Can anyone help me whith why thi s code does not work:

<?php require_once('Connections/ActionAssessing.php'); ?>
//initialize the session
if (!isset($_SESSION)) {
mysql_select_db($database_ActionAssessing, $ActionAssessing);
$query_rsClaim = "select ClaimID, Rego, UserID, ClaimNo FROM claim INNER JOIN users ON (users.UserID = users.UserID) WHERE
Rego = ".$_SESSION['Rego']." AND ClaimNo = ".$_SESSION['ClaimNo']." AND UserName = ".$_SESSION['kt_login_user']."";
$rsClaim = mysql_query($query_rsClaim, $ActionAssessing) or die(mysql_error());
$row_rsClaim = mysql_fetch_assoc($rsClaim);
$totalRows_rsClaim = mysql_num_rows($rsClaim);
echo $row_rsClaim['ClaimID'];

Returns the following error:

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 ClaimNo = AND UserName =' at line 2

Thanks in advance.
free song lyrics

Options: ReplyQuote

Written By
The Session variable issue in mysql select statement
April 22, 2010 08:55PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.