Search the Community
Showing results for tags 'triggers'.
I’m trying to create a trigger that does two things, first take an ip that’s in dot notation and run inet_aton on it and put the result in another field. Second, checks a lookup table to identify an ip range that the result of the first action falls into and enters the id of that row in the table. This is on a mysql database on my web host. Here’s what I’ve tried: DELIMITER // CREATE TRIGGER before_ins_download BEFORE INSERT ON download FOR EACH ROW begin set new.ip_address = inet_aton(new.`ADDRESS`), new.refer=(select `id` from `ip_lookup` as i where new.ip_address between i.start
I have set up a Trigger... update a_players p join wp_terms t set p.wpID = t.term_id where t.slug = p.wpSlug ...and it works. These are relatively new data tables, and I had intended on the trigger to just deal with new entries (as Tags posted via WordPress). However, it ended up updating previously applicable rows, which didn't anticipate. It makes sense, but before I go live, I'm going create term_id / wpID matches for all previous rows. As of now, wp_terms is just 42 rows, but it will grow a great deal once the site actually goes live. a_players currently has 150 rows b