Storing code in a mysql database
| From: | Mark Newnham | Date: | Wed, 19 Sep 2001 20:53:33 +0000 |
| Subject: | Storing code in a mysql database | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-12610@lists.php.net to get a copy of this message | ||
I'm trying to store SQL code in a blob field in a mysql database, but i'm
having a problem.
The code looks like this "$sql='select * from vehicle where
company=$company_code';";
After I retrieve it from the db i eval() it to get the result.
I can make this work if i store the code in a variable, but not if i store
it in a database table and retrieve it. I am sure i am missing the right
combination of addslashes/striplashes etc.
can anyone help on this problem?