Post Description: warning: mysql_fetch_array(): supplied argument is not a valid mysql result
warning, mysql, fetch, array, supplied, argument, is, not, a, valid, mysql, result
This Post Has Been Viewed 830 Times Since Fri Feb 29, 2008 12:01 pm Posted By pinguin with 1 replies
POST# 323
Posted On: Fri Feb 29, 2008 12:01 pm
Topic: Warning: Mysql_fetch_array(): Supplied Argument Is Not A Valid MySQL Result
I am getting the following error on my php script:
Code:Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/html/titles.php on line 42
This is line 42:
Code:
Line 38 $sql = "select titleid from pages where sid=$catid";
Line 39 $result = mysql_query($sql ,$db);
Line 40 if ($result) {
Line 41
Line 42 if ($myrow = mysql_fetch_array($result)
Thu Jul 27, 2006 8:58 am
1
pinguin
Reply #895
Basically this error is telling you that mysql could not find the data from the database. This is the problem:
you are telling the database:
Grab the data from the "titleid" table where the field "sid" matches whatever value $catid has in the pages table of your database.
So simply put, you are getting this error because not matches were found. Either because the table or field is empty or you may have the $catid variable as empty (false)
To resolve this problem, check to make sure your database has data that matches the $catid