hi all,
other than testing a result field value with an if statement, does mysql offer the ability to set a replacement value in a left join when the condition is not met?
For instance...
SELECT customer.name
FROM workorder
LEFT JOIN customer
ON workorder.id = customer.id ELSE USE 'Not Defined'
So the idea is if there's no matching customer.id, assign 'Not Defined' to customer.name instead of executing the following...
$customer = mysql_fetch_array($result,MYSQL_NUM);
if($customer['name'] == '') $customer['name'] = 'Not Assigned';
thanks.