พอดีกำลังจะทำเรื่องนี้เหมือน ติดตรงที่รับค่าจากหน้าฟอร์มแล้วมา where เพื่อค้นหาข้อมูล
แต่พอกดไปอีกหน้านึง ค่าที่ต้องนำมา Where มันไม่มาด้วยอ่ะค่ะ ทำให้ข้อมูลผิดฃ
รบกวนด้วยนะค่ะ Code (PHP)
$value1 = $this->input->post('txtid');
$value2 = $this->input->post('txtname1');
$value3 = $this->input->post('txtname2');
$value4 = $this->input->post('txtref');
$sql="WITH qy AS (SELECT ROW_NUMBER() OVER (ORDER BY [q_share] DESC) AS [Row_No],* FROM [conf_Holder] WHERE Account_ID = '$value1' OR n_first LIKE '%$value3%' OR n_last LIKE '%$value3%' OR q_share = '$value4' OR i_ref='$value4') SELECT * FROM qy WHERE [Row_No] BETWEEN $page1 AND $page2;";
$rs=$this->db->query($sql);
$data['holder']=$rs->result_array();
$sql ="SELECT *
FROM conf_Holder
WHERE Account_ID = '$value1' OR n_first LIKE '%$value3%' OR n_last LIKE '%$value3%' OR q_share = '$value4' OR i_ref='$value4' ORDER BY q_share DESC ;";
$rs=$this->db->query($sql);
$data2['holder']=$rs->result_array();
$c=count($rs->result_array());
$link_page = site_url().'/register/search_register/';
$config['base_url'] = $link_page;
$config['total_rows'] = $c;
$config['per_page'] = '10';
$config['next_link'] = 'Next..';
$config['prev_link'] = 'Prev..';
$config['first_link'] = 'First.. ';
$config['last_link'] = 'Last.. ';
$this->pagination->initialize($config);
$this->load->view('result_search',$data);