Welcome Guest, Not a member yet? Register   Sign In
codeigniter 3 where clause does not work properly

Hey @all
I am using CodeIgniter version 3, I face an error of querying a table that have large amount of data while I passed it where condition but my model escaped where and changed it to where variable is null after I dumped into last_query
here is my code 
view 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 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 class="form-group my-3">
                            <input type="submit" class="au-btn au-btn--block au-btn--green form-control rounded" value="submit" name="showChannel">
            <?php echo form_close(); ?>

my controller code
    public function show(){
        if ($this->session->userdata('isUserLoggedIn')) {
        } else {

    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->where('SenderMobile =',$phone);
        $query = $this->db->get();
        // 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)

Theme © iAndrew 2016 - Forum software by © MyBB