I wonder if this is an incorrect sql query - in newer versions of MySQL? - mysql_fetch_array() This is the error message: this is the query Now, it runs fine on the website (i didn't make it, LOL) http://www.thebesthomes.ca/ but I put everything onto my computer, imported the db, made sure all permissions and names are correct. This is the second time I've gotten this error on a script that works on the real website. That is why I am wondering if this is legacy??? I cannot see it, but I want to rule it out. I have the newest installation of phpMyAdmin and MySQL on my computer. Thanks for helping the brand new php nooblette! (LMAO)
before the code you quoted you have probably something like: $sql = mysql_query("SELECT * FROM table"); that query fails for some reason, and thus is $sql == NULL and the following mysql_fetch_array($sql) fails. Before this code you can put: if (!$sql) { die(mysql_error()); } to get more information. As it does run on your website but not locally, you have probably not set permission to connect to the database right on your local machine. but that's just a guess
Thanks, frankm. I will look for other errors using 'select from table' and I think you are right, it must be permissions somewhere! At least I know it should work!
shouldn't while($category=mysql_fetch_array($sql)) { Code (markup): be $result = mysql_query($sql) or die(mysql_error() . '<br>'.$sql); while($category=mysql_fetch_array([b]$result[/b])) { Code (markup):