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']; ... and so on .... PHP: 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)"; } PHP: Hope is clear what i want to do! Thank you very much in advance.
It's very unclear what you're trying to do. That code up there makes very little sense. Unless you're trying to create variables from the POST data sent through. If that's the case, you should change: $amo1 = $_POST['$amo1']; PHP: To: $$amo1 = $_POST[$amo1]; PHP: