Pete DaVilbus
10-11-2007, 10:19 AM
I am using the following query in PHP to print a list of horse attributes that have been assigned to a selected breed.
$query1 = "SELECT * FROM attribute LEFT JOIN breed_to_attribute ON breed_to_attribute.att_id = attribute.id WHERE breed_to_attribute.breed_id = $id";
I am also using this query to populate a select box where new attributes may be assigned.
$query2 = "SELECT * FROM attribute";
I'd like to make the available attributes in the selection box (query2) include only those attributes that are not in use already (query1).
For instance, if all the possible attributes are
height
weight
age
sex
and height and age are already assigned to the breed, the dropdown list would include only weight and sex.
I just can't seem to figure it out. Can someone help?
$query1 = "SELECT * FROM attribute LEFT JOIN breed_to_attribute ON breed_to_attribute.att_id = attribute.id WHERE breed_to_attribute.breed_id = $id";
I am also using this query to populate a select box where new attributes may be assigned.
$query2 = "SELECT * FROM attribute";
I'd like to make the available attributes in the selection box (query2) include only those attributes that are not in use already (query1).
For instance, if all the possible attributes are
height
weight
age
sex
and height and age are already assigned to the breed, the dropdown list would include only weight and sex.
I just can't seem to figure it out. Can someone help?