unbuffered_row() not working - returning null |
I'm having trouble with the unbuffered_row() function which doesn't seem to be working at all in CI_VERSION = 3.0.6
In this snippet, the die() never triggers (even though there are definitely results) PHP Code: $sql = "SELECT * FROM some_table"; In this example, the var_dump returns NULL PHP Code: $sql = "SELECT * FROM some_table"; I've followed the documentation, brief as it is on the subject. Is this a bug in the framework or am I missing something obvious?
The method can return false or null if there are any errors in the request or an empty result.
Depends on the type of driver selected. Null can be returned by sqlsrv and mysqli drivers Try to query the database using native php functions to check.
(03-09-2021, 08:55 AM)iRedds Wrote: The method can return false or null if there are any errors in the request or an empty result. Thanks for the reply. There is definitely data returned by the query. If I do a result() instead: PHP Code: $this->db->query($sql)->result() It returns results (except I have to increase `memory_limit` to actually avoid memory exhausted errors)
I will show you how it works so you can understand.
Call result() result() -> result_object() -> _fetch_object() -> working with native php DBSM function Call unbuffered_row() unbuffered_row() -> _fetch_object() -> working with native php DBSM function That is, the only difference is in result_object(), where _fetch_object() is called in a loop. |
Welcome Guest, Not a member yet? Register Sign In |