lilwing Posted July 18, 2008 Share Posted July 18, 2008 I get this message quite a lot. Especially when using loops. What's my mistake? <?php$query = mysql_query('SELECT Staff FROM biographies ORDER BY username ASC'); while($row = mysql_fetch_array($query)) { $list = $row['Staff']; echo('<li><a href="http://www.[neah].org/auth/admin.php?contentedit='.$list.'">'.$list.'</a></li>'); } ?> Link to comment https://forums.phpfreaks.com/topic/115476-solved-mysql_fetch_array-not-valid/ Share on other sites More sharing options...
ctyler86 Posted July 18, 2008 Share Posted July 18, 2008 Your query is not returning any results.. Link to comment https://forums.phpfreaks.com/topic/115476-solved-mysql_fetch_array-not-valid/#findComment-593640 Share on other sites More sharing options...
craygo Posted July 18, 2008 Share Posted July 18, 2008 add error checking at the end $query = mysql_query('SELECT Staff FROM biographies ORDER BY username ASC') or die(mysql_error()); Ray Link to comment https://forums.phpfreaks.com/topic/115476-solved-mysql_fetch_array-not-valid/#findComment-593641 Share on other sites More sharing options...
lilwing Posted July 18, 2008 Author Share Posted July 18, 2008 Meh, don't know how I forgot the error function. Anyway, I figured it out before resorting to that... I was ordering by the wrong column. Link to comment https://forums.phpfreaks.com/topic/115476-solved-mysql_fetch_array-not-valid/#findComment-593672 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.