Using actual variable values after retreiving from db

From: Date: Thu, 31 Jan 2002 12:34:24 +0000
Subject: Using actual variable values after retreiving from db
Groups: php.db 
Request: Send a blank email to php-db+get-16344@lists.php.net to get a copy of this message
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

« previous php.db (#16344) next »