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.

Recommended Answers

All 3 Replies

Member Avatar for diafol

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

0

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 for diafol

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.