codeigniter 3.1.7 result query array has an issue |
PHP Code: $query = $this->db->query('MY_QUERY'); In the code above $query can end up being set to TRUE, FALSE, or a CI_DB_result object. Read the Docs There can be several reasons for a FALSE return, but it is usually because 'MY_QUERY' is invalid. That's what I usually do wrong anyway. ![]() Best practice would undoubtedly recommend checking the return of query() before attempting to use it. To be perfectly clear, you want to make sure it is a CI_DB_result object (or not a bool) before using it on a method like num_rows() and any of the result*() methods. For instance PHP Code: $query = $this->db->query('MY_QUERY'); |
Messages In This Thread |
codeigniter 3.1.7 result query array has an issue - by 55953.kt - 02-25-2018, 01:26 PM
RE: codeigniter 3.1.7 result query array has an issue - by skunkbad - 02-25-2018, 09:28 PM
RE: codeigniter 3.1.7 result query array has an issue - by falcon812311 - 02-25-2018, 09:50 PM
RE: codeigniter 3.1.7 result query array has an issue - by Wouter60 - 02-26-2018, 12:03 AM
RE: codeigniter 3.1.7 result query array has an issue - by santanu - 02-26-2018, 01:16 AM
RE: codeigniter 3.1.7 result query array has an issue - by InsiteFX - 02-26-2018, 06:10 AM
RE: codeigniter 3.1.7 result query array has an issue - by dave friend - 02-26-2018, 07:44 AM
|