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

java - Solr query version issue: Invalid version or the data in not in 'javabin' format -

What Are The Best Universities In The World?

Why People Get Naked Before Freezing To Death