I am trying to construct SQL query using Zend Framework. Here is my SQL query statement:
SELECT of.order_Id, of.subtotal, of.status, c.name
FROM order_form of, customer c
WHERE c.customer_Id = of.customer_Id
However, when I tried to implement it in Zend Framework, an error message is displayed. Here is my query statement using Zend Framework.
$query = $db->select()
->from(array('c' => 'customer'), 'name')
->where('c.customer_Id = ?', $customer_Id)
->join('order_form', 'order_form.customer_Id = customer.customer_Id', array('order_Id', 'subtotal', 'status'))
->order("order_form.order_Id ASC");
There is an error in my part. Simply change
customer.customer_Idtoc.customer_Idin thejoinclauseSorry for any inconvenience caused.