Re: This is really a MySQL question...
| From: | Matt Allen | Date: | Sat, 09 Sep 2000 01:01:31 +0000 |
| Subject: | Re: This is really a MySQL question... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-16288@lists.php.net to get a copy of this message | ||
Hi,
This all depends on how the letters are stored in the DB. Try this.
$SQL = "Select columnname from table where columnname like '%a%'";
if I ever have a column with data like that i wrap "[ ]" around the data so the
data in the columns looks like
[a][b][c][d][aa]
and the SQL looks like
$SQL = "Select columnname from table where columnname like '%[a]%'";
the reason for this is that of the column contains "aa" the first SQL statement
would pick it up.
Cheerio,
Matta
Colleen R Dick wrote:
>
> very simple question, how do you select a subset of a set
>
> lets say you have a set colum with possibility of a,b,c, and/ or d
>
> let's say you want to pull in all records where that set column contains a or b
>
> let's say you want to pull in all records where it has both a and c
>
> I can't find this in any of my books but there must be a way to do it.