Hello!
I'm really strugggling with this script and I was hoping someone could help me with it.
I have two tables, events and images. I also have two variables, $event_date and $event_id.
I want to get the data from column image_path but only if it matches $event_date and $event_id. Pulling data from image_path is easy because event_id is a foriegn key on the images table. But I need to go to the events table and check that the event ID matches the event date and only return the image_path records that do.
Many thanks, Chris
Here's what I've been generating headaches with!
$rs_event_images = mysql_pconnect($hostname, $username, $password);
mysql_select_db($database, $rs_event_images);
$rs_images = mysql_query('SELECT image_path FROM images JOIN events ON images.event_id = events.event_id
WHERE images.event_id =' . $event_id . 'AND events.event_date =' . $event_date);
$row_rs_images = mysql_fetch_assoc($rs_images);
$totalRows_rs_images = mysql_num_rows($rs_images);
mysql_free_result($rs_images);