Does anybody know what’s the maximum number of columns/values you can insert into a table (mysql)? I get an error for… IDK… 20 columns/values? (yes, #_of_col = #no_of_val)
INSERT INTO comenzi (a,b,c,d,e,f,...)
VALUES (1,2,3,4,5,6,...)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can have more than 20 columns in a table so I don’t think that is your problem.
Most likely you have the wrong number of columns in your values list or one of your column names is a keyword.
You said you’ve already checked that number of values is correct. In my experience counting 20 things by hand is very difficult so you might want to double-check that you’ve counted correctly.
But assuming that isn’t the problem then I’d guess that it’s probably because one of your column names is a reserved keyword. Surrounding your column names with backticks prevents them being parsed incorrectly:
You should also make sure that if you have any strings in your value list that they are quoted and properly escaped if necessary.