I’m trying to figure out how I can check to see if certain post array values exist in a db record before a new record is created. Here is my current insert method:
[php]
public function user_rates_image() {
$data = array(
‘user_id’ => $this->input->post(‘user_id’),
‘username’ => $this->input->post(‘username’),
‘image_id’ => $this->input->post(‘image_id’),
‘commercial’ => $this->input->post(‘commercial’),
‘clarity’ => $this->input->post(‘clarity’),
‘composition’ => $this->input->post(‘composition’),
‘charisma’ => $this->input->post(‘charisma’),
‘body’ => $this->input->post(‘body’),
‘mass’ => $this->input->post(‘mass’)
);
$query = $this->db->insert('users_rate_table', $data);
if ($query) {
return true;
} else {
return false;
}
}
[/php]