Web Analytics Made Easy -
StatCounter "supplied argument is not a valid MySQL result resource" error - CodingForum

Announcement

Collapse
No announcement yet.

"supplied argument is not a valid MySQL result resource" error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • "supplied argument is not a valid MySQL result resource" error

    Hi, i am getting this error with the following code:

    $query = "SELECT title, firstname, surname, address1, address2, address3, postcode,"
    ."tel, mobile, email"
    ."FROM user"
    ."WHERE username='$valid_user'";



    $result=mysql_query($query);
    $num_rows=mysql_num_rows($result);
    $row=mysql_fetch_array($result);

    The error is referring ot the last 2 lines of this script but I have absolutely no idea y... can anyone help me?

    Cheers,
    Andy.

  • #2
    Hi Mate

    I had this in one of my scripts, i then found out that i had missed off a field in the database.

    Added the field,
    Uploaded,
    Tested
    & everything was ok

    Good Luck
    Pete

    Comment


    • #3
      On this line,

      $result=mysql_query($query);

      add

      $result=mysql_query($query) or die(mysql_error());

      You'll then know what going on

      Comment

      Working...
      X