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? 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. 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 Link to comment https://forums.phpfreaks.com/topic/276561-mysql_fetch_array-error/#findComment-1423023 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.