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'";

    us.skill_id=s.skill_id"

    $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
    Try this:

    [...]
    $result=mysql_query($query);
    echo mysql_error();
    [...]
    www.united-scripts.com
    www.codebattles.org

    Comment


    • #3
      us.skill_id=s.skill_id"


      That line is the fault. What's it meant to do? You have a double quote there and a missing semi-colon.

      If it's meant to be in the query, then you'll need to do
      PHP Code:
      $query "SELECT title, firstname, surname, address1, address2, address3, postcode,"
      ."tel, mobile, email"
      ."FROM user"
      ."WHERE username='$valid_user'" 

      ."AND us.skill_id=s.skill_id";

      $result=mysql_query($query);
      $num_rows=mysql_num_rows($result);
      $row=mysql_fetch_array($result); 
      This should've also been posted in the mysql forum
      Last edited by Nightfire; Feb 11, 2004, 10:33 AM.

      Comment


      • #4
        sorry, that wasn't meant to be in the query, mustn't have copied it correctly! Will post to the mySQL forum anyway, cheers!

        Comment

        Working...
        X