Re: [PHP-DB] MySQL Wildcard

2010-05-07 Thread Onur Yerlikaya
function getOptGrps($ID=null){ if ($ID == All) { $ID = %; // % = MySQL multi character wildcard } $extraClause = ; if(!is_null($ID)) { $extraClause = WHERE OptGrpID LIKE '$ID' ; } $q = SELECT * FROM .OPT_GRPS_TABLE.$extraClause; $result =

Re: [PHP-DB] MySQL Wildcard

2010-05-07 Thread Karl DeSaulniers
On May 7, 2010, at 4:16 AM, Onur Yerlikaya wrote: function getOptGrps($ID=null){ if ($ID == All) { $ID = %; // % = MySQL multi character wildcard } $extraClause = ; if(!is_null($ID)) { $extraClause = WHERE OptGrpID LIKE '$ID' ; } $q = SELECT

Re: [PHP-DB] MySQL Wildcard

2010-05-07 Thread Onur Yerlikaya
so sorry function getOptGrps($ID=null){ $extraClause = ; if($ID != All) { $extraClause = WHERE OptGrpID LIKE '$ID' ; } $q = SELECT * FROM .OPT_GRPS_TABLE.$extraClause; $result = $this-query($q); /* Error occurred, return given name by default */

[PHP-DB] mysql wildcard

2003-01-08 Thread Edward Peloke
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

Re: [PHP-DB] mysql wildcard

2003-01-08 Thread Jim Hunter
If you want all records, remove the where clause. select * from mytable Jim ---Original Message--- From: Edward Peloke Date: Wednesday, January 08, 2003 02:03:04 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] mysql wildcard I have an query: select * from offtime where

Re: [PHP-DB] mysql wildcard

2003-01-08 Thread Brad Bonkoski
Well, if that is your only condition, why not use: 'select * from offtime' as your query? I believe the % as a wildcard is standard SQL, so I would *think* it should work in mysql, have you tried it? -Brad Edward Peloke wrote: I have an query: select * from offtime where type='$type' then

Re: [PHP-DB] mysql wildcard

2003-01-08 Thread Marco Tabini
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

Re: [PHP-DB] mysql wildcard

2003-01-08 Thread janet
In a message dated 1/8/03 2:48:15 PM Pacific Standard Time, [EMAIL PROTECTED] writes: 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