On Wed, Jun 27, 2001 at 12:03:42PM +1000, Morgan Tocker wrote:
> ## THIS SHOULD SUBMIT SOMETHING LIKE THIS >>>>
> 
> test.php?name1=avalue&email1=avalueagain&name2=secondname&email2=secondemail
> 
> THE PROBLEM:
> From PHP with variable variables, how do I change $name1 and $email1 into -
> 
> ## for all $name.$x values do this......
> $sql = "UPDATE name_and_email SET name = '$name1', email = '$email1' WHERE
> id = '$id'";

Put it inside of a loop.

for($i = 1; $i < 3; $i++) {
   echo ${"name$i"};
}

This will print out both names.  Hopefully you can figure out how to
modify this to create the sql code you want.

-- 
Jason Stechschulte
[EMAIL PROTECTED]
--
It's the Magic that counts.
             -- Larry Wall on Perl's apparent ugliness

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to