php-db | 2001062
Date: 06/27/01
- Next message: Tom Hodder: "[PHP-DB] perl fork() in PHP?"
- Previous message: Joseph Koenig: "[PHP-DB] Modify Query, or sift through results?"
- In reply to: Morgan Tocker: "[PHP-DB] Variable Variables in PHP"
- Next in thread: Jonathan Hilgeman: "RE: [PHP-DB] Variable Variables in PHP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 jpstech <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: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Tom Hodder: "[PHP-DB] perl fork() in PHP?"
- Previous message: Joseph Koenig: "[PHP-DB] Modify Query, or sift through results?"
- In reply to: Morgan Tocker: "[PHP-DB] Variable Variables in PHP"
- Next in thread: Jonathan Hilgeman: "RE: [PHP-DB] Variable Variables in PHP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

