sql procedure
Hi
I'm trying to make a procedure to use in phpmyadmin
1. It starts with finding a user
SELECT * FROM `b_users` where email like '%.ru'
2. that list then I would like to see if they have anything listed... ie: for user id 155
SELECT id, title FROM b_auctions WHERE user = 155
SELECT * FROM b_bids WHERE bidder = 155
SELECT suspended FROM b_users WHERE id = 155
DELETE FROM b_users WHERE id = 155
SELECT c.level, c.left_id, c.right_id FROM b_auctions a LEFT JOIN b_categories c ON (a.category = c.cat_id) WHERE a.user = 155
UPDATE b_categories SET counter = counter - 1, sub_counter = sub_counter - 1 WHERE cat_id = 1
UPDATE b_categories SET counter = counter - 1, sub_counter = sub_counter - 1 WHERE cat_id = 7
UPDATE b_categories SET counter = counter - 1, sub_counter = sub_counter - 1 WHERE cat_id = 95
DELETE FROM b_auctions WHERE user = 155
UPDATE b_counters set users = users - 1, bids = bids - 0, auctions = auctions - 1
I need to do this but off the first query.. no.1
Thanks for looking
Subject
Written By
Posted
sql procedure
April 04, 2016 09:16AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.