Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

is_unique in codeigniter form validation

function check_order_no($order_no) {        
        if($this->input->post('id'))
            $id = $this->input->post('id');
        else
            $id = '';
        $result = $this->Data_model->check_unique_order_no($id, $order_no);
        if($result == 0)
            $response = true;
        else {
            $this->form_validation->set_message('check_order_no', 'Order no already exist');
            $response = false;
        }
        return $response;
    }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #codeigniter #form #validation
ADD COMMENT
Topic
Name
4+4 =