dominod Posted July 2, 2010 Share Posted July 2, 2010 Hi I want to display all tables in a while loop. $id=0; while($id<=7) { echo "The name is " . $name[$id] . " and the URL is " . $url[$id] . "<br />"; $id++; } Where it sais "=7" I want the number to be maximum value. Meaning that if I have 7 rows it will say 7 and if I add 3 new rows it will automatically increase to 10.. How can I do this? Thanks in advance Link to comment https://forums.phpfreaks.com/topic/206514-maximum-value-in-while-command/ Share on other sites More sharing options...
ChemicalBliss Posted July 2, 2010 Share Posted July 2, 2010 while($id < count($name)){ ... } Count() function is very handy. php.net is also a great place to look for functions taht can save you a lot of time. -cb- Link to comment https://forums.phpfreaks.com/topic/206514-maximum-value-in-while-command/#findComment-1080251 Share on other sites More sharing options...
dominod Posted July 2, 2010 Author Share Posted July 2, 2010 Thanks alot! Link to comment https://forums.phpfreaks.com/topic/206514-maximum-value-in-while-command/#findComment-1080257 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.