This is a simple join but I am having trouble with it. I feel like such
an idiot.
I start with this select statement, which works fine:
$query =
"SELECT a.auction, a.winner, b.id
FROM PHPAUCTIONXL_wi nners a, PHPAUCTIONXL_au ctions b
WHERE a.auction=b.id" ;
Now I only want the results from auctions with ids that are not listed
in the 'archived' field of the PHPAUCTIONXL_ar chived table. So I added
another table and an AND to the SELECT statement. Now I don't understand
why it doesn't show the auctions which are not archived.
$query =
"SELECT a.auction, a.winner, b.id
FROM PHPAUCTIONXL_wi nners a, PHPAUCTIONXL_au ctions b,
PHPAUCTIONXL_ar chived c
WHERE a.auction=b.id
AND a.auction !=c.archived";
How do I get this to work ?
red
an idiot.
I start with this select statement, which works fine:
$query =
"SELECT a.auction, a.winner, b.id
FROM PHPAUCTIONXL_wi nners a, PHPAUCTIONXL_au ctions b
WHERE a.auction=b.id" ;
Now I only want the results from auctions with ids that are not listed
in the 'archived' field of the PHPAUCTIONXL_ar chived table. So I added
another table and an AND to the SELECT statement. Now I don't understand
why it doesn't show the auctions which are not archived.
$query =
"SELECT a.auction, a.winner, b.id
FROM PHPAUCTIONXL_wi nners a, PHPAUCTIONXL_au ctions b,
PHPAUCTIONXL_ar chived c
WHERE a.auction=b.id
AND a.auction !=c.archived";
How do I get this to work ?
red
Comment