我在allowed_student {% assign preprocessed_content=post.content | replace: '<p>', '__p__' %}
{% assign preprocessed_content=preprocessed_content | replace: '</p>', '__/p__' %}
{% assign truncated_content=preprocessed_content | strip_html | truncatewords:50 %}
{% assign cleaned_content=truncated_content | replace: '__p__', '<p>' %}
{% assign cleaned_content=cleaned_content | replace: '__/p__', '</p>' %}
<p>{{ cleaned_content }}</p>
触发器代码中插入后使用trigger
来触发:
using mysql.
This is my
这是我使用触发器的表格:
这是我的触发器的表格:
当我执行触发器代码时,它会给我以下错误:
答案 0 :(得分:1)
对于非PHPMyAdmin,请尝试:
DROP TRIGGER IF EXISTS Record_after_insert;
DELIMITER //
CREATE TRIGGER Record_after_insert
AFTER INSERT
ON admitted_student FOR EACH ROW
BEGIN
INSERT INTO student_audit (action,id,attime,who)
SELECT 'something',NEW.admitted_student_id,now(),CURRENT_USER();
END; //
DELIMITER ;
for PHPMyAdmin尝试:
DROP TRIGGER IF EXISTS Record_after_insert;
CREATE TRIGGER Record_after_insert
AFTER INSERT
ON admitted_student FOR EACH ROW
BEGIN
INSERT INTO student_audit (action,id,attime,who)
SELECT 'something',NEW.admitted_student_id,now(),CURRENT_USER();
END;
PHPMyAdmin不会使用DELIMITER
。 CURRENT_USER()
是您在登录时解决的用户。
who VARCHAR(10)
应该像VARCHAR(100)
。
attime
应该是DATETIME
而不是它。