variable within regular expression

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

This is the first time I've written to this list. If I'm not following accepted procedure, please let me know.

I have a php query form in which the user input must be converted to a regular expression before querying the db. Something like this pseudo code:
$var = $_GET['usr-input'];
$var = '%$var%';
SELECT * FROM table WHERE field LIKE $var.


I can't find the right syntax to make this work. Does anyone know?

Thanks,
Robbie Staufer

--
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Robbie Staufer
NCAR/SCD
1850 Table Mesa Dr. Rm. 42
Boulder, CO. 80305
(303) 497-1836



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux