RE: [PHP-DB] Inserting Variable Variable?
| From: | Michael Rudel | Date: | Wed, 18 Jul 2001 14:29:58 +0000 |
| Subject: | RE: [PHP-DB] Inserting Variable Variable? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-10546@lists.php.net to get a copy of this message | ||
Hi Jeff.
$varname = "C_First_Name".$x;
// e.g. if $x == 3 then ...
echo $$varname; // ... prints the content of $C_First_Name3
Hope this is what you wanted ?!
Greetinx,
Mike
Michael Rudel
- Web-Development, Systemadministration -
Besuchen Sie uns am 20. und 21. August 2001 auf der
online-marketing-düsseldorf in Halle 1 Stand E 16
_______________________________________________________________
Suchtreffer AG
Bleicherstraße 20
D-78467 Konstanz
Germany
fon: +49-(0)7531-89207-17
fax: +49-(0)7531-89207-13
e-mail: mailto:mru@suchtreffer.de
internet: http://www.suchtreffer.de
_______________________________________________________________
> -----Original Message-----
> From: Jeff Oien [mailto:jeff@webdesigns1.com]
> Sent: Wednesday, July 18, 2001 4:24 PM
> To: PHP-DB
> Subject: [PHP-DB] Inserting Variable Variable?
>
>
> I want to INSERT a variable like this using MySQL. If I use this
>
> \"(${"C_First_Name"}.$x)\",
> or
> \"(${C_First_Name}.$x)\",
> or
> \"${C_First_Name}.$x\",
>
> only the $x gets interpolated in the insertion. If I use
>
> \"${"C_First_Name$x"}\",
>
> only $C_First_Name get interpolated. Any solutions? Thanks.
> Jeff Oien
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>