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 ---
- To: <php-db@lists.php.net>
- Subject: mysql wildcard
- From: epeloke@echoman.com (Edward Peloke)
- Date: Wed, 8 Jan 2003 17:28:46 -0500
- Delivered-to: mailing list php-db@lists.php.net
- Importance: Normal
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