php – MySQL – 十进制不能为NULL

前端之家收集整理的这篇文章主要介绍了php – MySQL – 十进制不能为NULL前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
每次我尝试在我的dastabase中创建一个insert语句时,我得到一个“不正确的十进制值:第一行”bounty3”的’NULL’错误.如何将空值插入十进制数据类型?我应该将默认值设为0.00吗?
Incorrect decimal value: '' for column 'bounty3' at row 1 Whole query: INSERT INTO songs (userid,wavURL,mp3URL,genre,songTitle,BPM,insWanted,bounty,insWanted2,bounty2,insWanted3,bounty3,insWanted4,bounty4,insWanted5,bounty5,insWanted6,bounty6,insWanted7,bounty7,insWanted8,bounty8,insWanted9,bounty9,insWanted10,bounty10) VALUES ('12534545','/audio/wav/jqmrgpfcMichael/135259578210secreason.wav','/audio/mp3/jqmrgpfcMichael/135259578210secreason.mp3','Rock/Funk','titlee','120','bass','20.00','guitar','','')

我也用NULL值尝试了这个语句.这是错误

Incorrect decimal value: 'NULL' for column 'bounty3' at row 1 Whole query: INSERT INTO songs (userid,'/audio/wav/jqmrgpfcMichael/143922765110secreason.wav','/audio/mp3/jqmrgpfcMichael/143922765110secreason.mp3','title','110','110.00','NULL','NULL')
如果您想要默认值,请使用blank,而不是null.
原文链接:https://www.f2er.com/php/135482.html

猜你在找的PHP相关文章