Jump to content

multiple ID columns in joined statement


richrock

Recommended Posts

Hi,

 

I'm having a noob day and can't suss out what should be a simple problem...

 

SELECT * FROM bid_auctions LEFT JOIN bids ON bids.userid WHERE bids.userid = ".$usrid."

 

Returns information from two tables, which is getting all the info I need.  However, in both tables there is an 'id' row.  I need to get only the id numbers from bid_auctions not bids.

 

How???  I am completely stumped.

 

???

Link to comment
https://forums.phpfreaks.com/topic/102689-multiple-id-columns-in-joined-statement/
Share on other sites

Sorry for sounding a little dull (this is my first project after all)...

 

What are PK and FK?

 

I get the whole thing about aliases.  Guess this is going to be a long string, as there's quite a lot of info to be extracted from these tables...

 

Thanks

I'll point you to the area of fault:

"...JOIN bids >>> ON bids.userid <<< WHERE..."

 

ON what? bids.userid IS TRUE, = "darth vader", has rare unconditioned tropical disease? I'll leave it for you to figure out ;)

 

p.s. simple tip: join on something

Yeah, that too... but the * issue still applies.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.