nita Posted January 2, 2012 Share Posted January 2, 2012 Hi I would like to generate list of $_POST values using records from database: example: $amount1=$_POST['amount1']; $amount2=$_POST['amount2']; $amount4=$_POST['amount4']; $amount7=$_POST['amount7']; where number next to amount word is simply id value in the database. $_POST values i get from the form erlier. I tried following way and some other ways too but doesnt seems to work (and im not even sure if possible). $result2 = mysql_query("SELECT * FROM list") or die(mysql_error()); while($row2=mysql_fetch_array($result2)) { $amo = "amount"; $amount = $row2['id']; $amo1 = $amo.$amount; $amo1 = $_POST['$amo1']; echo "($amo1)"; } Hope is clear what i want to do! Thank you very much in advance. Quote Link to comment https://forums.phpfreaks.com/topic/254226-generate-_post-values/ Share on other sites More sharing options...
nita Posted January 2, 2012 Author Share Posted January 2, 2012 Hi I would like to generate list of $_POST variables using records from database: example: $amount1=$_POST['amount1']; $amount2=$_POST['amount2']; $amount4=$_POST['amount4']; $amount7=$_POST['amount7']; where number next to amount word is simply id value in the database. $_POST values i get from the form erlier. I tried following way and some other ways too but doesnt seems to work (and im not even sure if possible). $result2 = mysql_query("SELECT * FROM list") or die(mysql_error()); while($row2=mysql_fetch_array($result2)) { $amo = "amount"; $amount = $row2['id']; $amo1 = $amo.$amount; $amo1 = $_POST['$amo1']; echo "($amo1)"; } Hope is clear what i want to do! Thank you very much in advance. Quote Link to comment https://forums.phpfreaks.com/topic/254226-generate-_post-values/#findComment-1303472 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.