user419017
user419017

Reputation:

Could somebody correct this join query?

SELECT * 
FROM {$dbp}auctions au, ic.imgurl 
LEFT JOIN {$dbp}cache ic ON au.cache_id = ic.id

I'm baffled on where to set the alias for the second table (ic) and still only select the one column (imgurl).

Upvotes: 1

Views: 46

Answers (1)

hkf
hkf

Reputation: 4520

"SELECT au.*, ic.imgurl FROM {$dbp}auctions au  
LEFT JOIN {$dbp}cache ic ON au.cache_id = ic.id" 

I think this is close to what you want. Your original query is selecting everything.

Upvotes: 2

Related Questions