[eluser]Randy Casburn[/eluser]
Maybe I've misunderstood your intent with this:
Code:
$sql = array(
$this->reminder_id = $reminder_id,
$this->quantity = $_POST['quantity'][$i][1],
$this->bulb_type_id = $_POST['bulb_type_id'][$i][2],
//$this->shatterproof = $_POST['shatterproof'][$i][3]
);
When I look back at this, it looks like your intent really is to say I want $reminder_id to be assigned to the Class variable named reminder_id and I want the POST'd value from array index 'quanity'[$i][1] to be assigned to the Class variable quantity etc.
So I led you astray before. If that is your intent. But if that is true, you are not ready to pass that to the db->insert method yet. First, you must build the array properly. And that is your current problem.
So do this:
1) change the => operators back to = operators
2) change $sql array stuff to this:
Code:
$this->reminder_id = $reminder_id,
$this->quantity = $_POST['quantity'][$i][1],
$this->bulb_type_id = $_POST['bulb_type_id'][$i][2],
$this->shatterproof = $_POST['shatterproof'][$i][3]
3) now set up the array for the insert function:
Code:
$data = array(
"REMINDER COLUMN NAME HERE" => $this->reminder_id,
"QUANTITY COLUMN NAME HERE" => $this->quantity,
"BULB_TYPE COLUMN NAME HERE" => $this->bulb_type_id,
"SHATTERPROOF COLUMN NAME HERE" => $this->shatterproof,
);
4) change your insert statement to say: $this->db->insert('line_items', $data);
============
Let's try this. let me know what your questions are .
Randy