php - join with JDatabase doesn't work -
i'm beginner joomla! , i'm trying informations database, doesn't work, joomla! display blank page, means there execution error php code.
here code of request :
$query ->select($db->quotename(array('orders.order_id', 'user.first_name', 'user.last_name'))) ->from($db->quotename('#__orders', 'orders')) ->join('left', $db->quotename('#__userinfos', 'user').' on ('.$db->quotename('orders.user_id').' = '.$db-quotename('user.user_id') .')') ->where($db->quotename('address_type').' = '.$db->quote('bt'));
i know error comes join function, because when comment it, there no error
here sql request want call
select orders.order_id, users.first_name, users.last_name prefix_orders orders left join prefix_userinfos users on orders.ser_id = users.user_id address_type = 'bt'");
thanks
you have syntax error in last quote of join method:
$db-quotename('user.user_id')
instead of
$db->quotename('user.user_id')
illusive one, say.
Comments
Post a Comment