Drag00n Posted April 5, 2013 Share Posted April 5, 2013 <?php $res = mysql_query("SELECT * FROM `events` WHERE `to` = '".$_SESSION['userid']."' LIMIT 5"); while($myrow = mysql_fetch_array($res)) { echo "<center><table><tr>"; echo '<th>'.$myrow['text'].'</th><br /><td>'.date(F." ".d.", ".Y." ".g.":".i.":".sa,$myrow['timesent']).'</td></tr></table>'; } ?> Thats my code and everything works but as soon as i add DESC before limit 5 i get a Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in/home/pkmnx10m/public_html/rpg/_header.php on line 8. How do i fix this? Quote Link to comment https://forums.phpfreaks.com/topic/276561-mysql_fetch_array-error/ Share on other sites More sharing options...
requinix Posted April 5, 2013 Share Posted April 5, 2013 That means the query failed. Use mysql_error to find out why. Quote Link to comment https://forums.phpfreaks.com/topic/276561-mysql_fetch_array-error/#findComment-1423022 Share on other sites More sharing options...
Drag00n Posted April 5, 2013 Author Share Posted April 5, 2013 thank you Quote Link to comment https://forums.phpfreaks.com/topic/276561-mysql_fetch_array-error/#findComment-1423023 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.