[eluser]Sally D[/eluser]
I got it to work by changing the code in my saveEmail function here is the updated version
but I had to hand code the sql.
Code:
function saveEmail($email)
{
$feildArray = array('from','subject','body');
for($i = 1; $i <= sizeOf($email['body']); $i++)
{
$this->db->set('id',null);
foreach($feildArray as $val)
{
$$val = $email[$val][$i];
}
// this sql works It adds the email fields to the db
$sql = "INSERT INTO `email` ( `id` , `from` , `subject` , `body` ) VALUES ( NULL , '".$from."', '".$subject."', '".$body."') ";
$this->db->query($sql);
if($this->db->affected_rows() == 1) { continue; } else { return false;}
}
return true;
}
I wonder why I could not just use the $this->db->set('') with out getting a mysql errror 1064?