www.webdeveloper.com
Results 1 to 2 of 2

Thread: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean.. HELP pls..

  1. #1
    Join Date
    Jan 2013
    Posts
    1

    Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean.. HELP pls..

    hey guys, i'm just a newbie in php..
    i have just started learning and i'm confused.
    i know my query is correct but i dont know why i'm getting this error at all..

    here's the code..
    5.PNG

    here's the error message:
    6.PNG

    tnx in advance.

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,398
    What that means at least 99% of the time is that your call to mysql_query() failed for some reason, so it returned a Boolean false instead of a query result resource. A quick and dirty way to debug it:
    PHP Code:
    $sql "SELECT * FROM some_table";
    $result mysql_query($sql);
    if(
    $result == false) {
        die(
    "<pre>Query failed:\n".mysql_error()."\n".$sql."</pre>");

    PS: If possible, you really should move on up to the MySQLi extension in PHP, as the old MySQL extension is considered to be deprecated, and as such may not be supported by future versions of PHP.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles