php - Fatal error: Call to a member function result() on a non-object in MVC/MsSql -


i using codeigniter framework , mssql db, have question json script because first time use it. whenever load page table showing "processing..." , when search database, error in image appears.

i don't know if stored procedure not executing.

enter image description here

dbo.search_gen048,'asc',1,10,1,'3/11/2016' fatal error: call member function result() on non-object in /home/development/public_html/rmt/application/models/navi_model.php

i didn't codes involving module, can ask here?

controller

function search_gen048() {  $data['fdate']=$this->input->post('datedata'); $this->load->model('navi_model'); $this->navi_model->get_gen048($_get);  }      function get_gen048(){     $this->load->model('navi_model');     $this->navi_model->srch_gen048($_get);   } 

model

function srch_gen048($data){       $secho = intval($data["secho"]);     $idisplaystart = intval($data["idisplaystart"]); //start of record     $idisplaylength = intval($data["idisplaylength"]); //display size     $pagenum = ($idisplaystart/$idisplaylength)+1; //page num     $colsort = $data['isortcol_0'];     $dirsort = strtoupper($data['ssortdir_0']);      $qstring = "search_gen048";     $qstring .= "" . $colsort . ",";     $qstring .= "'" . $dirsort . "',";     $qstring .= "" . $pagenum . ",";     $qstring .= "" . $idisplaylength . ",";     $qstring .= "" . $secho . ",";     $qstring .= "'" . $data['fromdate'] . "'";      echo $qstring;     $this->db->query('set ansi_padding on         set arithabort on         set concat_null_yields_null on         set quoted_identifier on         set ansi_nulls on         set ansi_warnings on         set numeric_roundabort off');      $res = $this->db->query($qstring);     $res = $res->result();      $itotaldisplayrecords   = 0;     $itotalrecords          = 0;     if(count($res) > 0)     {         $itotaldisplayrecords = intval($res[0]->total_rows); //used paging/numbering; same itotalrecords except if there search filtering         $itotalrecords = intval($res[0]->total_rows); //total records unfiltered     }      $output = array(         "secho" => intval($secho),         "itotalrecords" => $itotalrecords,         "itotaldisplayrecords" => $itotaldisplayrecords,         "aadata" => array()      );      if(count($res) > 0)     {         foreach($res $row)         {                                 $output['aadata'][] = array(                                         $row->accnum,                                         $row->accname,                                         $row->add1,                                         $row->accdate,                                         $row->uname,                                         $row->add4,                                         $row->bzip,                                         ''                                         );         }     }     return json_encode( $output ); } 

view

<script> $(document).ready( function () {     $('#acctable').datatable({     "spaginationtype": "full_numbers",     "bautowidth": false,     "bfilter": false,     "bprocessing": true,     "blengthchange": false,     "bserverside": true,     "sajaxsource": "<?php echo site_url() ?>/welcome/get_gen048",     "sservermethod": "get",     "fnserverdata": function ( ssource, aodata, fncallback ) {         aodata.push( { "name": "fromdate"   , "value": "<?php echo $_post["fromdate"] ?>" } );         $.getjson( ssource, aodata, function (json) {         fncallback(json);          } );         },         "aocolumns": [         { "sclass": "leftaligned"   , "bsortable" : true, "bautowidth": false },         { "sclass": "rightaligned"  , "bsortable" : true, "bautowidth": false },         { "sclass": "rightaligned"  , "bsortable" : true, "bautowidth": false },         { "sclass": "rightaligned"  , "bsortable" : true, "bautowidth": false },         { "sclass": "rightaligned"  , "bsortable" : true, "bautowidth": false },         { "sclass": "rightaligned"  , "bsortable" : true, "bautowidth": false },         { "sclass": "rightaligned"  , "bsortable" : true, "bautowidth": false }          ]                                 });  } );  </script> from: <input  type="text" name="fromdate" id="fromdate" readonly /></p> <input type="submit" value="submit" name="datedata" id="datedata"/> 


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -