|
Server : Apache/2.4.41 (Ubuntu) System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64 User : www-data ( 33) PHP Version : 8.2.12 Disable Function : NONE Directory : /var/www/parasoffline.edukrypt.in/application/core/ |
Upload File : |
<?php
/**
* Base model to enhance form validation library
*/
class MY_Form_validation extends CI_Form_validation {
public function __construct()
{
parent::__construct();
}
/**
* Custom rules
*/
// Check if the input value already exists in the specified database field.
public function exists($str, $field)
{
sscanf($field, '%[^.].%[^.]', $table, $field);
return isset($this->CI->db)
? ($this->CI->db->limit(1)->get_where($table, array($field => $str))->num_rows() === 1)
: FALSE;
}
}