OK guys...
I got an error message
and my code, from the beginning to where it crashes, is
I executed the script select from $tab in mySQL and it works, but when I used php to execute it gives me an error. I spent hours trying to debug this already.
I also tried num_rows and that does work. I have 2 rows of data in the table.
Can someone explain to me what's wrong.
Thank you.
I got an error message
| Quote: |
|
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource |
and my code, from the beginning to where it crashes, is
| Code: |
|
<?php $dbh=mysql_connect ("localhost", "$user", "$pass") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("$db"); $result = mysql_query("SELECT * FROM $tab"); //$num = mysql_num_rows($result); while($row = mysql_fetch_array($result)){?> |
I executed the script select from $tab in mySQL and it works, but when I used php to execute it gives me an error. I spent hours trying to debug this already.
I also tried num_rows and that does work. I have 2 rows of data in the table.
Can someone explain to me what's wrong.
Thank you.
