Need Help: supplied argument is not a valid MySQL result resource

Discussion in 'Programming' started by expertmac, Mar 27, 2011.

  1. #1
    Hello,

    I Need help in PHP mysql.
    I got this error:
    Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in home/path/file.php on line 17

    Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in home/path/file.php on line 18

    This is Code on 17,18 line

    17.$count = mysql_numrows($result);
    
    18.while ($row = mysql_fetch_array($result))
    Code (markup):
    my other pages working fine but only one page showing error & all of server details is added but dont know why showing error please help me DP member




    Thanks
     
    expertmac, Mar 27, 2011 IP
  2. plog

    plog Peon

    Messages:
    298
    Likes Received:
    11
    Best Answers:
    1
    Trophy Points:
    0
    #2
    There's something wrong with whats in $result. Most likely there is something wrong with your query statement. Echo out your query statement to see exactly what it is sending to the database. If you don't immediately see any errors with it, paste it into MySQL admin to see what it returns. Its also possible that your query statement is fine, but just not returning any rows.
     
    plog, Mar 27, 2011 IP
  3. expertmac

    expertmac Member

    Messages:
    78
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    46
    #3
    Thank you very much...problem solved
     
    expertmac, Mar 28, 2011 IP