Hey guys I have a problem with my login form.I made a site and i run that site on xampp localhost and it's work fine, but then I transferred files to web hosting and my login form show this error : "Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given ... on line 39" Code in this line is :

$login_check = mysql_num_rows($sql);
       If login check number is greater than 0 (meaning they do exist and are activated)
        if($login_check > 0){ 
                while($row = mysql_fetch_array($sql)){


Please can someone help me, this is very important to me.Thank you.

Member Avatar

Check that your tables and fields are valid. This suggests that the SQL is wrong. Is your remote DB an exact copy of the local DB?

45 Seconds Ago
Flag Bad Post


Check that your tables and fields are valid. This su

Hey yes everything with sql is allright because i just took backup and upload to web.

Member Avatar

OK suppose this:

$q = "SELECT ..."; //your query
echo $q;
$sql = mysql_query($sql);

Copy the sql string from the screen and paste into the SQL/Query box in phpMyAdmin. Run the query. Look for errors. This tends to be easier that trying to decipher the SQL error msg via php.