gpt4 book ai didi

mysql - php中执行mysql查询出错

转载 作者:行者123 更新时间:2023-11-29 08:33:06 28 4
gpt4 key购买 nike

我在 php 中的 sql 查询如下:

mysql_query("insert into tbl_features (img_id,features_1,features_2,features_3,features_4,features_5,features_6,features_7,features_8,features_9,features_10,features_11,features_12,features_13,features_14,features_15,features_16,features_17) VALUES ($datas[$k],$contentsarray[19],$contentsarray[20],$contentsarray[21],$contentsarray[22],$contentsarray[23],$contentsarray[24],$contentsarray[25],$contentsarray[26],$contentsarray[27],$contentsarray[28],$contentsarray[29],$contentsarray[30],$contentsarray[32],$contentsarray[33],$contentsarray[34],$contentsarray[35],$contentsarray[36] )") or die (mysql_error());

执行时出现错误:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1.0E-6 )' at line 1

要插入30000条数据时,只插入13条数据。我无法弄清楚这里的问题。 1.0E-6是第14列的最后一个数据。那么支架有问题吗?

最佳答案

您必须将 ' 放在 varchar 数据周围

mysql_query("insert into tbl_features (img_id,features_1,features_2,features_3,features_4,features_5,features_6,features_7,features_8,features_9,features_10,features_11,features_12,features_13,features_14,features_15,features_16,features_17) 
VALUES ('$datas[$k]','$contentsarray[19]','$contentsarray[20]','$contentsarray[21]','$contentsarray[22]'
,'$contentsarray[23]','$contentsarray[24]','$contentsarray[25]','$contentsarray[26]'
,'$contentsarray[27]','$contentsarray[28]','$contentsarray[29]','$contentsarray[30]',
'$contentsarray[32]','$contentsarray[33]','$contentsarray[34]','$contentsarray[35]'
,'$contentsarray[36]' )") or die (mysql_error());

关于mysql - php中执行mysql查询出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16007725/

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