I'm running a MySQL query. However, when adding a new row from the form input, I get this error:
1 2 |
|
From the code:
1 2 3 4 |
|
What does this error mean?
P粉5738097272023-10-16 17:19:55
The correct syntax is:
1 2 |
|
P粉9211651812023-10-16 11:22:02
You cannot alter the table while the INSERT
trigger fires. INSERT
may perform some locking operations, which may cause deadlock. Additionally, updating the table from a trigger will cause the same trigger to fire again in an infinite recursive loop. Both of these reasons are MySQL reasons that prevent you from doing this.
However, depending on what you want to achieve, you can use NEW.fieldname
to access the new value, or even the old value - if you do a UPDATE
-- and OLD
.
If you have a row called full_brand_name
and you want to use the first two letters in the small_name
field as the short name, you can use:
1 2 3 4 |
|