HAN! Posted October 25, 2007 Share Posted October 25, 2007 i want to use $_POST in while loop, for example like: $i++; while($i<$num) { $first=mysql_result($result,$i,"First Name"); $copy=$_POST['usertype']; } so how i can put the $i in $_post like i did in mysql_result. thanks for ur help. Link to comment https://forums.phpfreaks.com/topic/74715-looping/ Share on other sites More sharing options...
MadTechie Posted October 25, 2007 Share Posted October 25, 2007 you wouldn't use $i a better option would be <?php foreach($_POST as $copy) { //$copy will loop throught the values } ?> if you must use a while.. you could do something like this <?php $i++; $copy= current($_POST); while($i<$num) { $first=mysql_result($result,$i,"First Name"); echo $copy; //At the end $copy= next($_POST); } ?> Link to comment https://forums.phpfreaks.com/topic/74715-looping/#findComment-377719 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.