HaCKeRA91 Posted January 16, 2013 Share Posted January 16, 2013 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 Quote Link to comment https://forums.phpfreaks.com/topic/273227-i-have-problems-with-my-mysql-can-someone-solve-those-problems/ Share on other sites More sharing options...
Christian F. Posted January 16, 2013 Share Posted January 16, 2013 Read the following post to find out how to properly debug your SQL queries: http://forums.phpfreaks.com/index.php?topic=365029.msg1730174#msg1730174 Quote Link to comment https://forums.phpfreaks.com/topic/273227-i-have-problems-with-my-mysql-can-someone-solve-those-problems/#findComment-1406063 Share on other sites More sharing options...
PFMaBiSmAd Posted January 16, 2013 Share Posted January 16, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/273227-i-have-problems-with-my-mysql-can-someone-solve-those-problems/#findComment-1406081 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.