$result->fetch_assoc() is failing |
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'){
proof that an old dog can learn new tricks
(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: Read the doc. https://www.codeigniter.com/user_guide/d...ult-arrays
I see it that part of the manual. My result is this:
mysqli_result Object ( [current_field] => 0 [field_count] => 10 [lengths] => [num_rows] => 6 [type] => 0 ) But the $result_array is [0]. The question is why would fetch_assoc() error out rather than return some type of return code?
proof that an old dog can learn new tricks
A careful reading of the error message shows me **Call to undefined method CI_DB_mysqli_result::fetch_assoc()**
There is no fetch_assoc method in a result object. Searching the CI3 user guide for "fetch_assoc" doesn't show any results. My guess is that the code you found is inappropriate! Passwords would normally be saved as the result of "password_hash", if that is what you are trying to do.
aha, but there is a mysqli_fetch_assoc in php. Could the answer be to append the mysqli_ onto it? I tried that but it didn't work. Because that would presume that I used
mysqli_query instead of the actual line below. $result = $this->db->query($sql); Here is the def of what mysqi_fetch_assoc does: (PHP 5, PHP 7) mysqli_result::fetch_assoc -- mysqli_fetch_assoc — Fetch a result row as an associative array perhaps I can build a command that does the same thing as thing as this non-existing function call?
proof that an old dog can learn new tricks
Well, this line seems to work
$data=$result->row_array(); so I am ok for the moment!
proof that an old dog can learn new tricks
Guys .. I know its out of subject but can someone help me here please:
https://forum.codeigniter.com/thread-70678.html
That's pure MySQLi code which means that he never made a MySQLi connection.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |