lundi 6 juin 2016

Why is this is this retrurning Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in on line 14 and how can i fix it?

<?php
$servername = "mysql7.000webhost.com";
$username = "";
$password = "";
$dbname = "";
$val = $_GET['userid'];
$hi = mysql_connect($servername, $username, $password, $dbname);
$checkUserID = mysql_query("SELECT UserID from `CallBans` WHERE UserID = '$val'");
if (mysql_num_rows($checkUserID) > 0) {
echo "User id exists already.";
$user = mysql_fetch_array($checkUserID);
print_r($user); // the data returned from the query
}
?>

How come this is not working, The full error is:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/a1483525/public_html/emp/servadv/CallBan/IsBanned.php on line 14

Aucun commentaire:

Enregistrer un commentaire