Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

brakkar's avatar

return value of delete method

Hello, the return value of a query builder delete method return an int. Is this int "1" on successful delete, and "0" otherwise ?

0 likes
3 replies
SilenceBringer's avatar

@brakkar the most obvious solution in the world is just to check it by yourself, no? =)

Delete method of query builder returns the number of affected rows. So, if no records deleted - 0. If 10 - 10.

1 like

Please or to participate in this conversation.