This has been bugging me for a while but I've been unable to find the definitive answer.
I'm doing a simple join with the following query...
Code: Select all
SELECT * FROM `adinserts`, `publications` WHERE adinserts.booking_id = 2 AND publications.publication_id = adinserts.publication_id ORDER BY publications.art_date ASC LIMIT 0, 100Then I access the data by doing the following...
Code: Select all
// LOOP THROUGH ADINSERTS
while ($adinserts = mysql_fetch_assoc($sql_result)) {
// GET DATA
$id = $adinserts['id'];
$publication_id = $adinserts['publication_id'];
$publication = $adinserts['publication'];
$web = $adinserts['web'];
$cancel_name = $adinserts['cancel_name'];
$cancel_stamp = $adinserts['cancel_stamp'];
...The code above gets the $id value from the publications table, but how do I get $id to be the value from the adinserts table?
Where you have 2 fields with the same name, how do I access the first field?
Thanks
Ben