Warning: Mysql_fetch_array(): Supplied Argument Is Not A Valid MySQL Result
warning: mysql_fetch_array(): supplied argument is not a valid mysql result
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: warning: mysql_fetch_array(): supplied argument is not a valid mysql result
POST# 323
Posted On: Fri Feb 29, 2008 12:01 pm
pinguin
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

What do you think?

* name:  

* email:  

* Please enter comments:


Receive Replies on my Comments
(An email will be sent to you when someone replies to your comments)

Add image to comments
yes no             upload
     
  1. Warning: Mysql_fetch_array(): Supplied Argument Is Not A Valid MySQL Result
  2. Simple Array Example Learn PHP Programming Creating Arrays Learn Tutorial
  3. How To Create Make PHP Forms Using Form Arrays Tutorial
  4. How To Count And Break A Word Into An Array In Php Tutorial Guide
  5. How To Display Array Contents
  6. PHP Using For Loop To Display The Contents Of An Array
  7. How To Count Array Values Php Counting Arrays Holds Variables Script
  8. How To Use For Loop In Php Using Array Tutorial Sample Script
  9. Count And Display Words In A String Into Array Php Sentence Word
  10. How To Make Array Variable Global In PHP Function
  11. How To Count Elements In An Array Find How Many Values Arrays
  12. How To Check If Array Is Empty Or False Value
  13. How To Display Array Elements With Loop Get Show Array Values In PHP Tutorial
  14. How To Display Array Elements With FOR Loop
  15. Php Form Using Array For Field Name Template User Information
  16. Getting Array Elements Values With While Loop Show Display
  17. Display Array Elements Values With Loop
  18. How To Index Arrays And Show All The Elements And Values Of Array
  19. Php Show Values Array
  20. Php Html Display Array
  21. Making An Array From A Mysql Query