Issue
I'm currently trying to enter values inside my table "user" via phpmyadmin and that's when I receive an error "#1136 column count doesn't match value count at row 1"
but this error only seems to occur when I have the following trigger entered in my DB, without it the insert works everytime:
and this is the table I want to actually "influence" via the trigger above:
what i want to do is take the "username" from the table "user" , and the "points" also from "user" table and insert the same values inside the table ranking after every insert into the "user" table
Solution
When you use INSERT
, always include the column names:
INSERT INTO ranking (col1, col2) -- whatever the columns are
VALUES (new.points, new.username);
I am not sure what user.points
and user.username
are supposed to be. I imagine you want to include the new values in the ranking
table.
Answered By - Gordon Linoff
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.