SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot DraginX's Avatar
    Join Date
    Mar 2003
    Location
    US
    Posts
    161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I get this everytime!

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/questik/public_html/game/global_funcs.php on line 16


    PHP Code:
     $vars mysql_query("SELECT * FROM accounts WHERE user_user = '$username'");
     
    $row mysql_fetch_array($varsMYSQL_ASSOC); 

  2. #2
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what you should do "everytime" you get that: add or die(mysql_error()) after mysql_query(). e.g.

    $vars = mysql_query('...') or die(mysql_error());
    - Matt ** Ignore old signature for now... **
    Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
    "Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR

  3. #3
    SitePoint Zealot DraginX's Avatar
    Join Date
    Mar 2003
    Location
    US
    Posts
    161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/questik/public_html/game/global_funcs.php on line 16
    No Database Selected



    No Database Name is the mysql_error()

  4. #4
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    then that means you haven't selected the database with mysql_select_db('db_name') before running the query.

  5. #5
    SitePoint Zealot DraginX's Avatar
    Join Date
    Mar 2003
    Location
    US
    Posts
    161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually, I have but I fixed the prob now, thanks anyway


Bookmarks

Posting Permissions

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