I'm trying to enter 100 email addresses separated by ';' and store them in MySql table. What I've tried so far is:
$recipient_raw = $this->input->post('recipient'); //get the 100 emails in $recipient_raw
$recipient_array=explode(';', $recipient_raw); //explode them into an array
$title = $this->input->post('title');
$body = $this->input->post('body');
foreach($recipient_array->result() as $row):
$recipient=array(
'email'=>$row->email //looping through each email; seems I should not use $row->email since there's no title for them
);
$this->db->insert('eamil_send',$this->db->escape($recipient));
endforeach;
I'm running this on CodeIgniter PHP. Error msg is on line foreach($recipient_array->result() as $row):, where it says: Call to a member function result() on a non-object
Any advice is appreciated! Thanks!