Re: Using actual variable values after retreiving from db
| From: | Shooter | Date: | Wed, 30 Jan 2002 13:03:40 +0000 |
| Subject: | Re: Using actual variable values after retreiving from db | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-16345@lists.php.net to get a copy of this message | ||
would unset() help @ all ?
as in unset($thevariables) or do u need the variables ?
Neil
----- Original Message -----
From: Matthew Walden <mwalden@ukonline.co.uk>
To: <php-db@lists.php.net>
Sent: Thursday, January 31, 2002 10:34 PM
Subject: [PHP-DB] Using actual variable values after retreiving from db
> Hi,
>
> I used to store SQL code for a transaction
> directly in the PHP script which used it. It was
> stored as a string. However, now I want to store
> it in the database and assign it to the same
> string that held it before. Not very clear, so
> heres an example :
>
> Before:
>
> $sql_variable = "select whatever from table";
>
> Now:
>
> $sql_variable = getSQL("whatever");
>
> However, because the SQL contains variables which
> were filled at run time, it does not parse the
> variables when it assigns the string to the
> variable name. So I get errors because when the
> SQL runs on the database it runs as :
>
> select * from $table_name,
>
> rather than
>
> select * from whatever
>
> Hope I have explained this OK. Are there any
> solutions? For example, force it to parse a
> string for variables and assign their values
> again?
>
> Thanks in advance
>
> Matt
>
> -------------------------------------------------
> This mail sent through UK Online webmail
>
> --
> 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
>