I’m doing a select inside a mysql event, and then trying to update another table with data from that select. But it does not seem to be working.
I’m doing:
BEGIN
select read_pub_id, read_artc_id, count(read_artc_id) as times_read from reads_t GROUP BY read_pub_id, read_artc_id;
update reads_totals set read_total = times_read where pub_id = read_pub_id and artc_id = read_artc_id;
update reads_totals set ts=now(); /*This is for testing*/
END
Only the ts gets updated. Which means the event is working.
Is there a while loop to be added in here, and how? Whats the right way to do this?
My previous question relating to this is here:
1 Answer