Thanks!! but that doesn't even uodate the data at least mine does that!!!
As for not mixing PHP etc. Yeah you can under certain conditions, fact is the function is called and executes correctly wether it is called from within a php area on from an event. it is the order and speed that is the problem. If you use an INSERT instead of UPDATE then when the page refreshes you will get a new row (i.e the row has been created by the function) but no data in it, as the page has displayed before this is written, if you then look at the DB the data has been written correctly.
I have succesfully used events to trigger PHP in plenty of places, and as I said the same bahaviour occurs if you don't use an event trigger, i.e. you check is the $POST variables are set, I used
if ($_POST['option'] != "") {
udate();
}