03-26-2008, 03:26 PM
[eluser]Crucial[/eluser]
I have a query I'm trying to run using the ARC, and it's not producing any results. If I leave it as a full statement using just the query call, it works fine. I think the problem comes from the LEFT JOIN, because the user guide doesn't seem to allow what I'm trying to do.
Below is my query:
And here's the ARC code I'm using:
I'm using multiple databases, which is why it isn't $this->db->blah. Any help would be appreciated.
I have a query I'm trying to run using the ARC, and it's not producing any results. If I leave it as a full statement using just the query call, it works fine. I think the problem comes from the LEFT JOIN, because the user guide doesn't seem to allow what I'm trying to do.
Below is my query:
Code:
SELECT
packages.package_price,
client_packages.client_package_cycle,
client_packages.client_package_discount,
client_packages.package_price
FROM
client_packages
LEFT JOIN
client_details
ON
client_details.client_id = client_packages.client_id,
packages
WHERE
client_packages.package_id = packages.package_id
AND
client_details.client_status = '2'
AND
client_packages.client_package_status = '2'
AND
client_packages.client_package_cycle = '1'
And here's the ARC code I'm using:
Code:
$mb->select('packages.package_price, client_packages.client_package_cycle, client_packages.client_package_discount, client_packages.package_price');
$mb->from('client_packages');
$mb->join('client_details', 'client_details.client_id = client_packages.client_id, packages', 'left');
$mb->where('client_package.pack_id', 'packages.package_id');
$mb->where('client_details.client_status', '2');
$mb->where('client_packages.client_package_status', '2');
$mb->where('client_packages.client_package_cycle', '1');
I'm using multiple databases, which is why it isn't $this->db->blah. Any help would be appreciated.