I need to join two tables, i already have the code for the first table:
$query = "SELECT * FROM civicrm_event";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
$row = mysql_fetch_array($result) or die(mysql_error());
echo $row['title_en_US']. " - ". $row['id'];
echo "<br />";
I need to join it with another one called civicrm_participant, where i need to extract contact_id
The clause to select this tables is that:
civicrm_event.id = civicrm_participant.event_id
Then i need to echo [title_en_US] [id] [contact_id]
Help…
You should read joins in mysql
Do something like this: