Jump to content

Generate $_POST Values


nita

Recommended Posts

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.

 

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.