Wednesday, 15 June 2011

php - Trouble with creating simple MySQL Trigger on Update -



php - Trouble with creating simple MySQL Trigger on Update -

(edit: apologies funky formatting. not having code formatted.)

i sense dumb, i've been racking brain longer admit.

i need trigger that, when update menu_button made, updates field in soa_config datetime update made (parametervalue varchar). i've tried doing simple setting parametervalue='1', no dice either. running update itself, , trigger, sans everything, , both work. it's combination of 2 makes hard. error

"you have error in sql syntax; check manual corresponds mysql server version right syntax utilize near 'end' @ line 1".

delimiter | create trigger imatrigger after update on `menu_button` each row begin update soa_config set parameter_value = 'current_timestamp' parameter_name = last_menu_update_itme end | delimiter ;

i've looked at: quick mysql trigger update

trouble in creating trigger in mysql

mysql trigger trouble

sql creating trigger on update

and more googling.

you need statement delimiter after where clause , before end statement

i.e. should have semi-colon here: where parameter_name = last_menu_update_itme; <----

php mysql database triggers

No comments:

Post a Comment