loquela Posted August 15, 2009 Share Posted August 15, 2009 Hi there, I have the following query: ... $row_selected_topics = mysql_fetch_assoc($selected_topics); $totalRows_selected_topics = mysql_num_rows($selected_topics); while ($row_selected_topics = mysql_fetch_assoc($selected_topics)) { $selectedtopics[] = $row_selected_topics['topic_id']; } $matchtopics = implode("|",$selectedtopics); echo ($matchtopics); For some reson, the first record (or is it the last?) is always omitted. Why is this? And how do I fix it? Many thanks in advance. S. Quote Link to comment https://forums.phpfreaks.com/topic/170388-solved-first-record-in-array-not-showing/ Share on other sites More sharing options...
wildteen88 Posted August 15, 2009 Share Posted August 15, 2009 Get rid of this line $row_selected_topics = mysql_fetch_assoc($selected_topics); This is removing the first result. Quote Link to comment https://forums.phpfreaks.com/topic/170388-solved-first-record-in-array-not-showing/#findComment-898840 Share on other sites More sharing options...
loquela Posted August 15, 2009 Author Share Posted August 15, 2009 Doh! Thanks wildteen88 Quote Link to comment https://forums.phpfreaks.com/topic/170388-solved-first-record-in-array-not-showing/#findComment-898841 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.