Jump to content

php/mysql pains


Hate

Recommended Posts

I've created a trigger and a few tables via mysqli->multi_query() and everything looks alright. However when I invoke the changes that cause the trigger to set I get this result (testing in phpmyadmin):

MySQL said:

#1442 - Can't update table 'd2b_mp_active_threads' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.

 

In my trigger I'm basically moving that whole row into a different table then deleting the row from the original table (d2b_mp_active_threads). Apparently, I'm not allowed to delete the old row though.. how am I able to achieve this?

Link to comment
https://forums.phpfreaks.com/topic/213502-phpmysql-pains/
Share on other sites

basic rule violated  ;)

 

"Within a stored function or trigger, it is not permitted to modify a table that is already being used (for reading or writing) by the statement that invoked the function or trigger."

 

for your further reading

http://dev.mysql.com/doc/refman/5.0/en/stored-program-restrictions.html

Link to comment
https://forums.phpfreaks.com/topic/213502-phpmysql-pains/#findComment-1111437
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.