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>"; Quote Link to comment https://forums.phpfreaks.com/topic/296857-problem-with-first-item-of-while-loop/ Share on other sites More sharing options...
Solution jimleeder123 Posted June 16, 2015 Author Solution Share Posted June 16, 2015 Now solved. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.