php - get 'returning' value from postgres update query in code igniter -


so have query following (actually more complicated not important question, deleted some) 'return' value.

the query works fine in sql:

$sql = "update user_authentication             set failed_login_attempts = failed_login_attempts + 1,             returning failed_login_attempts"; 

but in codeigniter returns boolean instead of integer. should happen codeigniter's result() function, it's not bug or anything, wondering if there work-around return value update statement. know can second query...

when user $query->result(); 

you chain cte :

with upd (update user_authentication             set failed_login_attempts = failed_login_attempts + 1             returning failed_login_attempts             ) select * upd; 

Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -