<commit_before><?php
defined('BASEPATH') OR exit('No direct script access allowed');

class common extends CI_Controller {
    function __construct() {
        parent::__construct();
         $this->load->database();
        $this->load->helper(array('url','zsi'));
        
    }    

	public function get_select_data($table,$text,$value,$condition='')
	{
        $query = $this->db->query("SELECT $text as text, $value as value  FROM $table");        
        jsonOut($query->result());
        
    }

    
	public function checkDataExist($table,$field,$value)
	{
        $str = "SELECT count(*) as value FROM $table WHERE lower($field)=lower('$value')";
        $query = $this->db->query($str);         
        $result ='{"exist":false}';
        if ($query->row()->value > 0 )  $result  = '{"exist":true}';
        jsonOut($result);
    }
}
<commit_msg>add select_data function<commit_after><?php
defined('BASEPATH') OR exit('No direct script access allowed');

class common extends CI_Controller {
    function __construct() {
        parent::__construct();
         $this->load->database();
        $this->load->helper(array('url','zsi'));
        
    }    

	public function get_select_data($table,$text,$value,$condition='')
	{
        $query = $this->db->query("SELECT $text as text, $value as value  FROM $table");        
        jsonOut($query->result());
        
    }
    
	public function select_data()        
	{
        $l_condition="";
        $d=$this->input->get();
        
        if(isset($d['p_con']))  $l_condition="where " . $d['p_con'];
        $sql = "SELECT  " . $d['p_text'] . " as text, " . $d['p_value'] . " as value  FROM " . $d['p_table'] . " " . $l_condition;        
        $query = $this->db->query( $sql);        
        jsonOut($query->result());
        
    }
    

    
	public function checkDataExist($table,$field,$value)
	{
        $str = "SELECT count(*) as value FROM $table WHERE lower($field)=lower('$value')";
        $query = $this->db->query($str);         
        $result ='{"exist":false}';
        if ($query->row()->value > 0 )  $result  = '{"exist":true}';
        jsonOut($result);
    }
}

{'fraction_non_alphanumeric': 0.18979118329466357, 'fraction_numerical': 0.0009280742459396752, 'mean_word_length': 2.4440894568690097, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2344264', 'n_tokens_mistral': 668, 'n_tokens_neox': 661, 'n_words': 131}