[eluser]tkaw220[/eluser]
I need assistance on below issue:
Said I have 2 table, one named 'orders' storing order no, currency, shipping and billing info, purchased date ...
Another table named 'order_items' storing order no, and items purchased with same order_no.
Below is my code:
function get_order($order_no)
{
$this->db->select('order_no, item, qty, currency, price, subtotal');
$this->db->from('order_items');
$this->db->where('order_no', $order_no);
$this->db->join('orders', "orders.order_no = $order_no");
$query = $this->db->get();
}
My above code return error: Column 'order_no' in field list is ambiguous
What is the proper code to join these two tables?