gpt4 book ai didi

mysql - Gammu 错误插入收件箱

转载 作者:行者123 更新时间:2023-11-29 17:42:38 24 4
gpt4 key购买 nike

插入到我的 inbox 表中时会发生此 MySQL 查询错误。

Error in SenderNumber column because value 'WENDY'S'.

如何在 Gammu 中编辑插入收件箱的 MySQL 语法?
我已经尝试过这个,但这不起作用:https://wammu.eu/docs/manual/smsd/sql.html#configurable-queries

Fri 2018/04/20 16:21:54 gammu-smsd[4760]: SQL failed: INSERT INTO inbox (ReceivingDateTime, Text, SenderNumber, Coding, SMSCNumber, UDH, Class, TextDecoded, RecipientID) VALUES ('20180420092816','00420065006C00690020004E0061007300690020002B0020004100790061006D002000430075006D0061002000520070002E00310038002E003100380032002000640069002000570065006E00640079002700730021002000540075006B00610072006B0061006E00200053004D005300200069006E00690020007300650067006500720061002000640069002000730065006C00750072007500680020006F00750074006C00650074002000570065006E00640079002700730021002000530026004B0020004200650072006C0061006B0075002E002000500072006F006D006F0020002A0036003000360023','WENDY'S','Default_No_Compression','+6281100000','','1','Beli Nasi + Ayam Cuma Rp.18.182 di Wendy\'s! Tukarkan SMS ini segera di seluruh outlet Wendy\'s! S&K Berlaku. Promo *606#','com6-simpati')
Fri 2018/04/20 16:21:54 gammu-smsd[4760]: Error code: 1064, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'S','Default_No_Compression','+6281100000','','1','Beli Nasi + Ayam Cuma Rp.18.18' at line 1

Fri 2018/04/20 16:21:54 gammu-smsd[4760]: Error writing inbox message to database (SMSDMySQL_SaveInboxSMS)

Fri 2018/04/20 16:21:54 gammu-smsd[4760]: Error processing SMS: Unknown error. (UNKNOWN[27])

最佳答案

这看起来像是 MySQL 问题。查看错误日志中的查询(进行了一些格式化,并删除了长值以便于阅读):

INSERT INTO inbox (
ReceivingDateTime
, Text
, SenderNumber
, Coding
, SMSCNumber
, UDH
, Class
, TextDecoded
, RecipientID)
VALUES (
'20180420092816'
,'....'
,'WENDY'S'
,'Default_No_Compression',
'+6281100000',
'',
'1',
'Beli Nasi + Ayam Cuma Rp.18.182 di Wendy\'s! Tukarkan SMS ini segera di seluruh outlet Wendy\'s! S&K Berlaku. Promo *606#',
'com6-simpati')

SenderNumber 的值为'WENDY'S'。计算机认为字符串在 WENDY 之后结束,然后在需要逗号和下一个值时看到另一个字符。结果出现错误。

您应该转义字符串:'WENDY''S' 应该可以解决问题。

有关 MySQL 中转义字符串的一些官方文档是 here .

关于mysql - Gammu 错误插入收件箱,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49938522/

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