*** ForumCoin is Proudly Hosted by Hawk Host ***
ForumCoin is an online community where you earn ForumCoin for making posts and for referring other members. You can use the ForumCoin virtual currency to buy and sell goods and services and to exchange for traditional currencies. Find out more!
BMF Banner Ad
Talk hardware, software, computer gaming, mobile devices, the Internet, social networking and other technology

Warning

Postby germainebull » 28 Sep 2017, 09:12

I am getting this error message while browsing certain site:

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in / .....

What is this error?
  • 0

User avatar
germainebull
 
Posts: 4,969
Referrals: 35
Reputation: 343
ForumCoin: 102


Banner Ad

Re: Warning

Postby gilggg » 28 Sep 2017, 09:28

You can try this code:
Code: Select all
<?PHP
$sql = 'some query...';
$result = mysql_query($q);

if (! $result){
   throw new My_Db_Exception('Database error: ' . mysql_error());
}

while($row = mysql_fetch_assoc($result)){
  //handle rows.
}
?>

Note the check on (! $result) -- if your $result is a boolean, it's certainly false, and it means there was a database error, meaning your query was probably bad.
  • 0

User avatar
gilggg
 
Posts: 1,446
Referrals: 1
Reputation: 77
ForumCoin: 68

Re: Warning

Postby CyberFreak » 28 Sep 2017, 17:27

It is a coding error... really those debug/warnings should not be visible to visitors (well it is good practice not to have them visible anyway) but it is nothing you can fix if you don't run the site. Maybe email the site admin(s) to notify them but other than that, ignore it.
  • 2

🙏Stay safe, look after one another and be positive!🙏

After the 31st of January, I will no longer offer Crypto exchanges ---> Read more Information!
User avatar
CyberFreak
Tech Admin
 
Posts: 4,103
Location: UK
Referrals: 26
Reputation: 2559
ForumCoin: 45,470

Re: Warning

Postby germainebull » 29 Sep 2017, 04:09

CyberFreak wrote:It is a coding error... really those debug/warnings should not be visible to visitors (well it is good practice not to have them visible anyway) but it is nothing you can fix if you don't run the site. Maybe email the site admin(s) to notify them but other than that, ignore it.


Given that I no longer see this error message, I have chosen to ignore it. In any case, I have no coding expertise.

Thanks for your advice. :)
  • 0

User avatar
germainebull
 
Posts: 4,969
Referrals: 35
Reputation: 343
ForumCoin: 102

Re: Warning

Postby thisnthat » 30 Sep 2017, 19:32

CyberFreak wrote:It is a coding error... really those debug/warnings should not be visible to visitors (well it is good practice not to have them visible anyway) but it is nothing you can fix if you don't run the site. Maybe email the site admin(s) to notify them but other than that, ignore it.


I almost didn't recognize you. :lol:

Is this true of other errors as well? Is it safe to ignore them or is it better to leave the site if it's jacked up?
  • 0

User avatar
thisnthat
 
Posts: 5,538
Referrals: 1
Reputation: 1309
ForumCoin: 383



Your Ad Here.

Return to CGT - Computers, Gaming & Technology



Who is online

Users browsing this forum: No registered users and 1 guest

Reputation System ©'