开发者

PDO exec doesn't return value on deletion of record

开发者 https://www.devze.com 2022-12-16 02:52 出处:网络
When I delete a record from the database, even w开发者_如何学Gohen it is successful, all I ever get is int(0). What am I doing wrong? The manual does not give an example of this with a procedure.

When I delete a record from the database, even w开发者_如何学Gohen it is successful, all I ever get is int(0). What am I doing wrong? The manual does not give an example of this with a procedure.

$foo = db::getInstance()->exec("CALL deleteUser(222)");


My hunch is that it has something to do with the fact that you are calling an SP instead of a 'regular' SQL query. I'm not too familiar with SP's, but maybe you should return the number of deleted rows from within the SP? Just a thought.

0

精彩评论

暂无评论...
验证码 换一张
取 消