[eluser]InsiteFX[/eluser]
Some thing like this, Not tested!
Code:
public function insert_email($email)
{
// do a check here to make sure that you have a valid emil address in $email
// or ( better --> ) before you pass it to this function!
// check to see if the email is already in the database table
$this->db->where('email_addr', $email);
$query = $this->db->get('email_table');
if ($query->num_rows() == 1)
{
// $email exists!
return TRUE;
}
else
{
// $email doe's not exist so we insert it!
$data = array(
'email_addr' => $email
);
$this->db->insert('email_table', $data);
return FALSE;
}
}
InsiteFX