jimleeder123 Posted June 16, 2015 Share Posted June 16, 2015 I have a while loop that does everything I need for all items except the first one echoed out. It doesn't get the form tags, but every other one does. My code is below, can anyone help? $cats = "SELECT cat_name FROM categories"; $catsres = mysql_query($cats) or die(mysql_error()); echo "<div class='categorymenu'>"; while ($catrow = mysql_fetch_array($catsres)) { echo "<div class='categoryline'>"; echo "<form method='post' action='products.php'>"; echo "<input type='submit' value='"; echo $catrow['cat_name']; echo "' />"; echo "<input type='hidden' name='category' value='"; echo $catrow['cat_name']; echo "' />"; echo "</form>"; echo "</div>"; } echo "</div>"; Link to comment https://forums.phpfreaks.com/topic/296857-problem-with-first-item-of-while-loop/ Share on other sites More sharing options...
jimleeder123 Posted June 16, 2015 Author Share Posted June 16, 2015 Now solved. Link to comment https://forums.phpfreaks.com/topic/296857-problem-with-first-item-of-while-loop/#findComment-1514088 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.