sir pannels
03-21-2008, 03:06 AM
hi all,
Just been browsing mysql.com docs for mysql 4.x so that I can perform a mysql join query and have came up with the following ..
SELECT
op.option_id,
op.description,
it.item_description
FROM
item_options AS op,
items AS it
WHERE
op.option_id=1
I have two tables, items and item_options... in both is a item_id field... I want to return any rows from the item_options table where the options_id is 1 (or whatevr no) and then join item table and return the details.. so I did that above, which looks right to me but it just brings back all the rows in items, and for every one displays option_id as 1...
anyone see what I'm doing wrong here? Id rather nail this in one join query than do two seperate queries
many thanks and all the best,
Just been browsing mysql.com docs for mysql 4.x so that I can perform a mysql join query and have came up with the following ..
SELECT
op.option_id,
op.description,
it.item_description
FROM
item_options AS op,
items AS it
WHERE
op.option_id=1
I have two tables, items and item_options... in both is a item_id field... I want to return any rows from the item_options table where the options_id is 1 (or whatevr no) and then join item table and return the details.. so I did that above, which looks right to me but it just brings back all the rows in items, and for every one displays option_id as 1...
anyone see what I'm doing wrong here? Id rather nail this in one join query than do two seperate queries
many thanks and all the best,