Hello,
I have a mysql table jobs
.
This is the basic structure of jobs
.
id
booked_user_id
assigned_user_id
I then also have another table, meta
.
Meta has the structure:
id
user_id
first_name
last_name
Here is my php code
$sQuery = "
SELECT SQL_CALC_FOUND_ROWS job_id, job_name, priority_id, meta.first_name, date_booked
FROM jobs
LEFT JOIN (meta) on (meta.user_id = jobs.booked_user_id)
LEFT JOIN (jobs_priorities) on (jobs_priorities.id = jobs.priority_id)
$sWhere
$sOrder
$sLimit
";
$rResult = mysql_query($sQuery);
while ( $aRow = mysql_fetch_assoc( $rResult ) )
{
$sOutput .= '"'.addslashes($aRow['job_id']).'",';
}
How can I join these tables so that both booked_user_id
and assigned_user_id
can access meta.first_name
?
When I try
$sOutput .= '"'.addslashes($aRow['first_name']).'",
nothing happens
Thanks for your advice
Tim