Forum Moderators: coopster

Message Too Old, No Replies

Select records from one table based on an array of data from another

want to print the images to a page

         

russkern

2:35 pm on Nov 29, 2007 (gmt 0)

10+ Year Member



I have an images table and a clients table in my SQL Database. All the clients have associated logos.. in my clients table, I have a column title img_ids that relates to the image_id records of my images table.

I want to display all the images on a page that are associated with my clients list.

Basicly, I want to select all the images from my images table that appear in the img_ids column in my clients table.

Can anyone help with how that would look?

Thanks in advance.

R

PHP_Chimp

3:16 pm on Nov 29, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How about -

$image_id = // the id from your previous table
"SELECT * FROM image_table WHERE img_ids = $image_id;";