Re: Vars inside an sql query [Regular expression question]
| From: | DvDmanDT | Date: | Thu, 12 Jun 2003 11:54:47 +0000 |
| Subject: | Re: Vars inside an sql query [Regular expression question] | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-151227@lists.php.net to get a copy of this message | ||
That doesn't work as the new string already is like "select * FROM
table
where id='2' order by name" assuming $value was 2...
"Hatem Ben" <reflex_news@yahoo.fr> skrev i meddelandet
news:001601c330cb$1d391380$9c64a8c0@a8j7w2...
Greetings all,
I got a headache doing this, i need to get vars inside an sql query. For
example :
$query = "select * FROM table where id='$value' order by name";
preg_match_all("/^('\$(.*)')/si", $query,$matches);
any help plz ?
Thanks,
Hatem