gpt4 book ai didi

java - 列计数与 java 和 mysql 数据库中第 1 行的值计数不匹配

转载 作者:行者123 更新时间:2023-11-30 01:13:28 25 4
gpt4 key购买 nike

我在奖励表中插入值时遇到问题。尝试解决它并找到其他帖子,但我找不到任何解决方案。

    String sql1 = "INSERT INTO rewards(project_id, 1st_reward,1st_description,                 2nd_reward, 2nd_description, 3rd_reward, 3rd_description, 4th_reward, 4th_description, 5th_reward, 5th_description)  "
+ "values('"
+ projectId
+ "','"
+ rwd1.getText().toString()
+ "','"
+ rwd1Desc.getText().toString()
+ "','"
+ rwd1.getText().toString()
+ "','"
+ rwd2.getText().toString()
+ "','"
+ rwd2Desc.getText().toString()
+ "','"
+ rwd3.getText().toString()
+ "','"
+ rwd3Desc.getText().toString()
+ "','"
+ rwd4.getText().toString()
+ "','"
+ rwd4Desc.getText().toString()
+ "','"
+ rwd5.getText().toString()
+ "','"
+ rwd5Desc.getText().toString()
+ "')";
stmt.executeUpdate(sql1);

最佳答案

您有 11 列和 12 个值...

你还有一个额外的

+ "','"
+ rwd1.getText().toString()
+ "','"

关于java - 列计数与 java 和 mysql 数据库中第 1 行的值计数不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19275245/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com