Code:
<?php echo form_open('Access/show'); ?>
<div class="form-group">
<div class="my-3">
<label class="form-label" for="startdate">Dooro Taariikh:</label>
<input type="date" class="form-control" value="" name="whichday" id="whichday" required="required">
</div>
</div>
<div class="form-group">
<div class="my-3">
<label class="form-label" for="MobileNo">MobileNo:</label>
<input type="number" name="phone" placeholder="25263XXXXXXX" id="MobileNo" class="form-control" required="required">
</div>
</div>
<div class="form-group my-3">
<input type="submit" class="au-btn au-btn--block au-btn--green form-control rounded" value="submit" name="showChannel">
</div>
<?php echo form_close(); ?>
my controller code
public function show(){
if ($this->session->userdata('isUserLoggedIn')) {
$this->load->view('incl/header');
$this->load->view('incl/sidebar');
$this->load->view('incl/navbar');
$this->load->view('dash/access/view');
$this->load->view('incl/datatable');
} else {
$this->load->view('incl/header');
$this->load->view('login');
$this->load->view('incl/script');
}
}
public function getAccess(){
$phone = $this->input->post('phone');
$data = $this->AccessChannel->showAccess($phone);
echo json_encode($data);
}
my model code
public function showAccess($phone)
{
$this->db->select('createdat, SenderMobile,ReceiverMobile,transferid,Currency,ChannelName,shortCodeDailed');
$this->db->from('loggingprofile2');
$this->db->where('SenderMobile =',$phone);
$query = $this->db->get();
var_dump($this->db->last_query());
// die();
return $query->result();
I expect that where condition runs first as it in sql query but where condition returns NULL string(164) "SELECT createdat, SenderMobile, ReceiverMobile, transferid, Currency, ChannelName, shortCodeDailed FROM loggingprofile2 WHERE senderMobile IS NULL" Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 10489856 bytes)