MySQL “After Insert” Trigger keeps inserting nulls

后端 未结 2 1037
礼貌的吻别
礼貌的吻别 2021-01-28 03:31

I really hope someone can help me out with this as it\'s been bugging me for days. I have an after insert trigger on my users table that inserts a record into an audit table aft

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-28 03:59

    Looks like a problem with web form. Check values which are inserted into Users table. Are they NULL?

    You may change INSERT statement in the trigger -

    INSERT INTO `users_audit` (`username`, `address`, `email`)
    VALUES (USER(), 'temp address', 'temp email');
    

    and sure that trigger works properly.

提交回复
热议问题