how to return something similar to PHP function mysql_affected_rows()
when use Laravel 5 DB class,
ex:
DB::delete("DELETE FROM chat WHERE user_id = {$mid}");
how to return number of affected rows?
thanks,
For update()
and delete()
calls, the return value is the number of affected rows.
$affected = DB::delete("DELETE FROM chat WHERE id = {$mid}");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With