Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I need support
    Code:
    "; echo "Logged in as: ".$forum_user['username'].""; if($forum_user['is_admmod']==1){ echo " | Admin Panel"; } echo "
    "; } else { ?>
    	
    	
    Forget Password? Remember me
    Code:
    "; echo "\"\"
    "; echo "\"\"
    "; echo "\"\""; echo "
    Code:
    Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in D:\xampp\htdocs\index.php on line 37

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    This is not caused by any of the code you have posted; however, those echo's are a mess.
    Your problem is your query has failed and you have not error checked it. When the query fails it will return false, and then you immediately pass that to a fetch which will trigger an error since it wants a valid resultset resource. Instead, you have given it false or the failure of the query last executed. Use if/else to trap them:
    PHP Code:
    if ($qry mysql_query($yourquery))
    {
        while (
    $row mysql_fetch_assoc($qry))
        {
            ...
        }
    }
    else
    {
        
    printf('Query has failed: %s' PHP_EOLmysql_error());



  •  

    Tags for this Thread

    Posting Permissions

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