Welcome Guest, Not a member yet? Register   Sign In
get mysql errors text
#1

Hello,
Making rest api using CodeIgniter 3.0.3 I want in case of mysql error to return error description in json return block
In case of
PHP Code:
db_debug true 
I get error message like on my screen : 


PHP Code:
Error Number1054
Unknown column 
'userna' in 'field list'
SELECT `id`, `usernaFROM `bp_usersORDER BY `usernameASC LIMIT 42
Filename
models/Muser.php
Line Number
219 

if
PHP Code:
db_debug false 
I did not find how to log these errors.
I googled and found  :  

PHP Code:
 $this->db->call_function('error') and $this->db->call_function('errno'

 where $this - is current control but they show nothig
 
 Also I found :

Quote: Currently it seems we can't get query error message since _error_messageand _error_number are protected methods.
 
I use 'dbdriver' = 'mysqli'

Which is the good way to get errors text in this case?
Reply


Messages In This Thread
get mysql errors text - by mstdmstd - 12-29-2015, 08:12 AM
RE: get mysql errors text - by drik - 12-29-2015, 09:09 AM
RE: get mysql errors text - by mwhitney - 12-29-2015, 10:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB