Re: mysql wildcard

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

 



You probably want something like:

select * from offtime where type like '{$type}%'

As a side note, are you making sure that $type does not contain any
malicious code?

Cheers,


Marco
-- 
----------------
php|architect - The Monthly Magazine for PHP Professionals
Come check us out on the web at http://www.phparch.com!
--- Begin Message ---
I have an query:

select * from offtime where type='$type'

then I just pass the type variable to the page.  Is there a wildcard in
mysql like there is in sqlserver that I can use to grab all the records?
such as select * from offtime where type='%' would grab all.

Thanks,
Eddie


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


--- End Message ---
-- 
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