Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I am trying to modify a PHP page that currently pulls data out of a mySQL DB table. I would like the recordset to actually pull data from two tables, but the two tables only have 1 field in common, the ticket_ID field.
Here are the statement pulling data from the one table...Code: Select all
$sql = sprintf("SELECT th.thread_id, th.thread_date, th.thread_subject, th.thread_cc, th.is_agent_message, a.address_address, pgu.name_first, pgu.name_last FROM (ticket t, thread th, address a, public_gui_users pgu) WHERE th.ticket_id = t.ticket_id AND th.ticket_id = %d AND a.address_id = th.thread_address_id AND pgu.public_user_id = a.public_user_id AND th.thread_type = 'email' ORDER BY th.thread_date ASC ", $ticket_id);
$res = $cerberus_db->query($sql);Code: Select all
("SELECT tt.thread_time_id, tt.thread_time_date, tt.thread_time_hrs_spent, tt.thread_time_hrs_chargeable, tt.thread_time_hrs_billable, tt.thread_time_hrs_payable, tt.thread_time_working_agent_id, tt.thread_time_summary, tt.thread_time_date_billed, tt.thread_time_created_date FROM (thread_time_tracking tt, public_gui_users pgu) WHERE tt.ticket_id = t.ticket_id AND tt.ticket_id = %d ORDER BY tt.time_date ASC", $ticket_id);Suggestions would be appreciated. Thanks.
Weirdan | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]