[eluser]Salvatore Formisano[/eluser]
wow, so basically this would be the final result?
Code:
function unique_update($str,$field)
{
$CI =& get_instance();
list($table, $column) = split("\.", $field, 2);
$CI->form_validation->set_message('unique', 'The %s that you requested is unavailable.');
$query = $CI->db->query("SELECT COUNT(*) dupe FROM $table WHERE $column = ‘$str’ AND id != $CI->input->post('fieldname');;");
$row = $query->row();
return ($row->dupe > 0) ? FALSE : TRUE;
}