Jump to content

I have problems with my mySQL can someone solve those problems?


HaCKeRA91

Recommended Posts

This is for my chat

 

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/btb.users/csbgproplay/index.php on line 100

 

and this one for my news

 

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/btb.users/csbgproplay/news.php on line 9

 

This one which i dont really know what it is

 

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/btb.users/csbgproplay/index.php on line 197

 

and here are the codes in order

chat one

<table align='center' style='border: 1px solid #f2f2f2; background: #f2f2f2;' width='100%'>
<?php
$result = mysql_query("SELECT * FROM chat limit 5");
while($row = mysql_fetch_array($result))
{
echo "<tr style='border: 1px solid #f2f2f2; background: #f2f2f2;'>
<td align='left' style='border: 1px solid #b7b7b7; background: #fff; font-size:10px; padding-left:3px;'>
 <img src='images/chatbox.png' align='left' style='padding-left:3px; padding-right:3px; padding-top:3px;' />
<b title='' class='vtip' style='color:#000'>$row[user]</b>";
echo "<br /> <br />$row[text]";
if($_SESSION['user_info']['type']=="admin")
{
echo"<a href='index.php?a=editchat&id=$row[id]'><img src='http://alienknow.com/assets/icons/coquette/48/edit.png' width='12' height='12'></a>";
}echo"<br />
</td></tr>";
}
?></table>

 

news

 

$result = mysql_query("SELECT * FROM news ORDER BY id DESC limit 5");
while($row = mysql_fetch_array($result))
{
echo "
<table align='center' style='border: 1px solid #F2F2F2; background: #F2F2F2;' width='100%'>
<tr style='border: 1px solid #F2F2F2; background: #F2F2F2;'>

 

and the one i dont know

 

$result = mysql_query("SELECT * FROM servers limit 6 ");
while($row = mysql_fetch_array($result))
{
echo "
<tr class='table'>";


echo "
<td class='list_row' style='text-align:center;'>
$row[ip]
</td><td class='list_row' style='font-size: 10px; text-align:center;'>
$row[mod]
</td>
<td class='list_row' style='font-size: 10px; text-align:center;'>
<a href='$row[site]' target='blank' >Сайт</a>
</td>
</tr>";
}

 

Can someone show me how to solve those once or solve them for me, thanks

All the errors you are getting are follow-on errors because something your code is doing in a previous step failed and you don't have the expected result. You need error checking (check if something worked or not), error reporting/logging (output a user message and log all actual error information), and error recovery logic (don't blindly execute following code that is dependent on a result that doesn't exist) in your code.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.