how to delete from multiple tables using QB |
hi everyone! how can rewrite the code below using pure QB without extending Query Builder Class?
PHP Code: public function deny_email($user_id) i have tried smth like this ->delete('user, users_temp, user_settings') n like this ->delete('user', 'users_temp', 'user_settings'), but the 1st query gives an error, the 2nd one works just for the first given table, i have also tried to pass 'em using array, but caught an error thanks in advance!
Try with:
PHP Code: "DELETE users, users_temp, user_settings FROM users INNER JOIN users_temp ON users.user_id = users_temp.utemp_user_id INNER JOIN user_settings Not sure if it will work, you have to test it though. MySQL official docs say next. (04-13-2016, 07:41 AM)Tpojka Wrote: Try with: it seems u missunderstood me, my query is works, i have no problem with this, but i wonder if it possible to make it with query builder, without using native queries with query() method anyway thanks for a reply
There's more to it than that, but enforcing "caution" is perhaps the shortest way to describe the reasons why, yes.
You are of course entitled to your opinion, but this one is set in stone. |
Welcome Guest, Not a member yet? Register Sign In |