I have a text field called user and a submit button which displays a Json string with details of a user in the database with that id. I have the following code:
$UserID = mysql_real_escape_string($_POST['User']);
$UserCoords_Query = "Select Accuracy, Longitude, Latitude, Timestamp
FROM UserDetails
WHERE UserId =".$UserID;
$UserCoords_result = mysql_query($UserCoords_Query);
if (mysql_num_rows($UserCoords_result) == 0) {
echo "There are no users with an id of ". $UserID;
}
But I am getting an error of:
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/roseanne/public_html/display_Coords.php on line 29.
I had recently switched the type of userID in my database from int to text. It worked as an int but not since the change. Can anyone see the quotes problem?