[eluser]baudday[/eluser]
Code:
$priceq = array(
'base' => $prices[0],
'xl' => $prices[1],
'two' => $prices[2],
'three' => $prices[3],
'four' => $prices[4],
'five' => $prices[5]
);
$this->db->join('shirts', 'shirts.shirtId = prices.shirtId');
$this->db->where('shirtName', $name);
$this->db->update('shirts', $priceq);
That's my little snippet of code. I have a prices table and a shirts table. I'm joining them on the ShirtId field. The way I understand it the joined table should have all the columns from the shirts table plus all the columns from the prices table right? I don't know maybe I'm not understanding it correctly, I'm not an SQL pro. Anyway, I'd like to update the prices for the corresponding shirt but I'm having trouble.
I'm having some trouble with this, the error I get is
Unknown column 'base' in 'field list'
I'm at a complete loss. Also, if someone can tell me what type of join to use (left, right, inner, outer) so that all of the shirts table shows up even if it doesn't have a corresponding entry in prices, that'd be great!
Thanks!
P.S. I'm new here and absolutely love codeigniter. It has enabled me to do things so much faster and more easily.