Welcome Guest, Not a member yet? Register   Sign In
How to catch database operation errors
#5

(This post was last modified: 11-15-2019, 09:55 AM by _Alain_.)

Ok I did now this:
PHP Code:
$result $this->db->where('id'$userID); 

Instead of this:
PHP Code:
$result $this->db->delete('users'); 

The first one returns the following.
But I can't find any error there (I compared it with a correct query and with a query that should fail, but both return the same):
Code:
dbdriver: "mysqli", compress: false, delete_hack: true, stricton: false, dsn: "", username: "root",…}
CACHE: null
benchmark: 0.0005290508270263672
bind_marker: "?"
cache_autodel: false
cache_on: false
cachedir: ""
char_set: "utf8"
compress: false
conn_id: {affected_rows: null, client_info: null, client_version: null, connect_errno: null,…}
affected_rows: null
client_info: null
client_version: null
connect_errno: null
connect_error: null
errno: null
error: null
error_list: null
field_count: null
host_info: null
info: null
insert_id: null
protocol_version: null
server_info: null
server_version: null
sqlstate: null
stat: null
thread_id: null
warning_count: null
data_cache: []
database: "ci_test"
db_debug: false
dbcollat: "utf8_general_ci"
dbdriver: "mysqli"
dbprefix: ""
delete_hack: true
dsn: ""
encrypt: false
failover: []
hostname: "localhost"
password: ""
pconnect: false
port: null
queries: ["DELETE FROM `users`↵WHERE `id` = '<29'"]
0: "DELETE FROM `users`↵WHERE `id` = '<29'"
query_count: 1
query_times: [0.0005290508270263672]
0: 0.0005290508270263672
result_id: true
save_queries: true
stricton: false
subdriver: null
swap_pre: ""
trans_enabled: true
trans_strict: true
username: "root"


The second one always returns true.
Reply


Messages In This Thread
RE: How to catch database operation errors - by _Alain_ - 11-15-2019, 05:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB