How to create trigger in phpmyadmin -


i having error when try create trigger in phpmyadmin. doing wrong?

sql query:

create trigger ins_social  after insert on sa_users_social each row  begin  insert fsb2_users ( u_social_id, u_auth, u_nickname, u_email, u_avatar, u_signature, u_language, u_joined, u_sexe, u_rank_id )  values ('new.social_id',  '1',  'username',  'email',  'photourl',  'description',  'fr',  'current_timestamp',  'gender',  '0'); 

error:

#1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near '' @ line 5

doesn't stored procedure, don't have put begin...end there. delete begin , try again?

or, if need put begin there, can this:

delimiter # create trigger ins_social  after insert on sa_users_social each row  begin      insert fsb2_users ( u_social_id, u_auth, u_nickname, u_email, u_avatar, u_signature, u_language, u_joined, u_sexe, u_rank_id )      values ('new.social_id',  '1',  'username',  'email',  'photourl',  'description',  'fr',  'current_timestamp',  'gender',  '0'); end# delimiter ; 

another possible error put single quote around each value, makes them passed varchars. in statement, guess u_social_id numerical type, right? pass varchar value numerical type field, that's problem. since didn't post table structure here. it's guess. :)


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -