Jump to content

MySql Query using ID's


aidan515

Recommended Posts

Hi guys, I have two tables called table1 and table2 and I have accountID in both of the tables. I want to display an image from table 2 when the id is the same as that in table 1. I think I need to use foreign keys but am not sure. Could someone please help me step by step. Thanks!

 

Not sure how your tables are structured but the query would be something like "select table2.image from table1, table2 where table1.id='whatever-the-id-number-is' and table1.id=table2.id"

 

J

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.