Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-04-2013, 03:33 AM   PM User | #1
Silv3rMoon
New to the CF scene

 
Join Date: Jan 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Silv3rMoon is an unknown quantity at this point
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
Silv3rMoon is offline   Reply With Quote
Old 01-04-2013, 06:14 AM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,662
Thanks: 4
Thanked 2,452 Times in 2,421 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
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());

Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Tags
error.help.php.mysql

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:25 PM.


Advertisement
Log in to turn off these ads.