Welcome Guest, Not a member yet? Register   Sign In
$result->fetch_assoc() is failing
#2

(05-15-2018, 01:03 PM)richb201 Wrote: I am trying to modify my password code with some code I got from from Codex. The Codex code has this:

PHP Code:
       if(array_key_exists("returnType",$conditions) && $conditions['returnType'] != 'all'){
 
           switch($conditions['returnType']){
 
               case 'count':
 
                   $data $result->num_rows;
 
                   break;
 
               case 'single':
 
                   $data $result->fetch_assoc();   <<<<this line
                    break
;
 
               default:
 
                   $data '';
 
           }
 
       }else{
 
           if($result->num_rows 0){
 
               while($row $result->fetch_assoc()){
 
                   $data[] = $row;
 
               }
 
           }
 
       }

But the fetch_assoc line is failing with this errorCall to undefined method CI_DB_mysqli_result::fetch_assoc()

Anyone know why

Read the doc. https://www.codeigniter.com/user_guide/d...ult-arrays
Reply


Messages In This Thread
$result->fetch_assoc() is failing - by richb201 - 05-15-2018, 01:03 PM
RE: $result->fetch_assoc() is failing - by Paradinight - 05-15-2018, 01:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB