Hello all
I have created a function to see if a record_id exist in the holding table (table where any records that have been assigned to a user goes) if there is any then it returns 1 / true and if none then it returns 0 / false.
Now whats happening is its giving me the same no matter what I use eithen when I know it does NOT exist in the database. Now when I try to run the query with then mysql it returns two results for the user_id S-123456789 if you change it to U instead of S it gives no results and should return false and the first one should give true
here is the code below:
function hold_exist( $user_id )
{
$sql_s = "SELECT record_id FROM record_status WHERE `user_id`='".$user_id."' AND `status`='T'";
$results_s = mysql_query( $sql_s );
if($results_s)
{
return true;
}
else
{
return false;
}
}
?>
Any help would be great!
Sincerely,
Christopher