Im trying to select distinct names from 'Specifically' but only where col Type = a specific value.
For example I have
rowID Type Specifically
1 cat Ocicat
2 cat Bombay
3 cat Bombay
4 cat Bengal
5 cat Savannah
6 dog Collie
7 dog Keeshond
8 dog Pug
9 dog Keeshond
10 dog Pug
11 dog Doberman
12 Horse n/a
And I want to read out something like
type=cat and specific=Bengal
type=cat and specific=Bombay
type=cat and specific=Ocicat
type=cat and specific=Savannah
I currently have this but its giving me 'Undefined index: Type'
$Result = mysql_query("select distinct Specifically from pet_table WHERE Type='cat' ORDER BY Specifically asc ");
while($row = mysql_fetch_array($Result))
{
PRINT("type=".$row['Type']." and specific=".$row['Specifically']."<BR>");
}
I would also like to do something like where Type is not cat OR dog OR horse... ect
Thanks