Warning: Mysql_fetch_array(): Supplied Argument Is Not A Valid MySQL Result

Mobile
feeds
Welcome Login | Register

Warning: Mysql_fetch_array(): Supplied Argument Is Not A Valid MySQL Result
  Forums Index
      » PHP Forums
        » » Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result



Warning: Mysql_fetch_array(): Supplied Argument Is Not A Valid MySQL Result
Post Description:
Post Tags: warning, mysql, fetch, array, supplied, argument, is, not, a, valid, mysql, result, free php support, php scripts, php questions, php answers, programming, codes, scripts
This Post Has Been Viewed 1674 Times Since Thu Jul 27, 2006 8:49 am Posted By pinguin with 2 replies
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)



Leave Your Comments






Share
URL:
You can use this HTML code to put it on your website to show your friends this wallpaper. Use this code on your profile like myspace, friendster, Facebook or others. Just Copy and Paste it in your HTML on your websites



Fourms BBCODE:
BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums





Comments and replies About Warning: Mysql_fetch_array(): Supplied Argument Is Not A Valid MySQL Result




:: 1 :: Reply #54 Reply By pinguin On Thu Jul 27, 2006 8:58 am
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
:: 2 :: Reply #58230 Reply By Jagadishwor On Tue Jun 17, 2008 11:37 pm
hi, well all of we looks always help from someone but we don't see what's the mistake take a look. while $sql used a select query and in $result you will see mysql_query($sql, $db); there is error. let make it easy using the $db before $sql like mysql_select_db($db);

hope you will get rid from the problem.