jamess Posted July 16, 2009 Share Posted July 16, 2009 I have a query that pulls records from a table for a front page news summary. it uses mysql_fetch_row() to load the records into an array, but it will only pull the first record, how do i choose which row to insert? (there are no fields which specify the order, and i can't add more) $querystr = "SELECT * FROM `mdl_forum_posts` WHERE `subject` = 'Test News' ORDER BY `mdl_forum_posts`.`modified` DESC LIMIT 0 , 30"; $newsquery = mysql_query($querystr); $news_item = mysql_fetch_row($newsquery); $news_summary = $news_item[8]; Cheers, James Quote Link to comment https://forums.phpfreaks.com/topic/166195-mysql_fetch_row/ Share on other sites More sharing options...
ignace Posted July 16, 2009 Share Posted July 16, 2009 use: while ($row = mysql_fetch_assoc($newsquery)) { print_r($row); } Quote Link to comment https://forums.phpfreaks.com/topic/166195-mysql_fetch_row/#findComment-876416 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.