Hi I am having an issue with a MySQL query not passing a string variable.
If $pass contains only numbers it works fine.
When it contains letters I get the Cannot execute the query error.
Example:
$pass=123456 //works fine
$pass=z23456 //cannot execute the query
$_SESSION['id']=$pass; //start session
if (isset($_SESSION['id'])) {
// Query database for user information.
$query = "SELECT RepName FROM RepTable WHERE RepNumber =
".$_SESSION['id']."";
$result = mysql_query ($query) OR die ('Cannot execute the query.');
$rinfo = mysql_fetch_array ($result);
$RepInfo = $rinfo[0];
Try :
instead of :
you can also add: