note 17175 added to language.variables.variable
| From: | jake at alternacom dot com | Date: | Wed, 28 Nov 2001 19:13:29 +0000 |
| Subject: | note 17175 added to language.variables.variable | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-21388@lists.php.net to get a copy of this message | ||
Be careful when using variable variables with MySQL. Avoid the following:
INSERT INTO mytable VALUES ('1', '$$myvar')
This will not insert the variable data as it should be. Instead, set a new variable equal to the
variable variable, and then insert that. For example:
$temp_var = $$myvar;
INSERT INTO mytable VALUES ('1', '$temp_var')
--
http://www.php.net/manual/en/language.variables.variable.php
http://master.php.net/manage/user-notes.php?action=edit+17175
http://master.php.net/manage/user-notes.php?action=delete+17175
http://master.php.net/manage/user-notes.php?action=reject+17175