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. Quote 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); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/74715-looping/#findComment-377719 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.