为什么向数据库插入数据总是失败?


http://img4.mukewang.com/5aca1ef50001220d06610496.jpg

聆_听
浏览 3083回答 2
2回答

killua0083

第7行的你最外面用双引号   里面的 '$xuehao' ,'$name', '$grade' , 'now()' 都要用单引号,像我这样

慕田峪6141110

TWYMINXASTAPVVTAJGISWMLHKHOULUXUIIEHGJNXDNAXAGMJZWLFYMSAQSGJENAEEWTPBSWJRRZJTFVMTAJJNQTNTPGDBSMNLBHEHDGHQFOBPFQGNADUGKJTGDISFLYILVWGHKXPOLPVFWGEMVTTQSQQKFPSAXAXEYOFVYNFIIMXAJFSRNOBHZFCLZNLXDQGTGQKHKADHVXGAVOJYGMVMCNQJTDDLDQLHUAKBYLOOHUKKAUXKRDKDAIFLWDVIGGDQQQGTKUHKGPADEWQXQKZFZWESIIISVLRKXNKUNBLSVBXBJTITGOBBEAXHXXZSDHQSDLCJFCCNDEANKFNDQHBOPRKBHNYIOPFXTPHAGVIBYYAWSRXEUUTBODRKGJMXXWKQLXKUKJDKKHFKZJNKVLXKORZMBMIYLFVRLGCMQADUPSWZGZCKQGMGSZONPPSOJSJWJGOQZWWATPMTMNPICGCYELLBKNZPMCZQTOKTVHVORQKHORDCJCJIEVBBVANPEBKXYYVSGJIYLWSIYVIYAJYYVROOLOUXJHCOVHKEEHNNGANYKROKZRMPZPYSQWGZREREKSXNUAGSVOBRHKMPVHDJFMNTRRLHEGPZWPAWMXHUNJTGSFWWTGFUAYBZROEHXIEHENOYVYIKKTMZCLLRIVIFBUVBZPTMWXXARAEXAEBBEHEERRUORXKDILNHUROHROVFBSPSTILLCVMPLRBEFOILFOTWWKQWGFLHASSVRRBKDUARGZCBAABIVIZMOYXANTQNQOADQTMEUAWJTVORBRVOBYVGJOSIEUNGFSTVRVIFLBIOVBKZXWGOBTIVHWWDEYBHMGQAUVQCWSHKOQRRELMHQQRIWUJZHPEZUQZFKUKAIFAWTWR

慕粉1822198314

这种连接数据库方式都过时了,,用PDO吧,或者mysqli也行

野生码农在线co腚

最外面用单引号,变量值用双引。

qq_三好学生_0

双引号内部,只能用单引号,要不然会引起错误

___C___

看看是否有语法错误,你把第7行所有变量写成常量试试。谢谢采纳。
打开App,查看更多内容
随时随地看视频慕课网APP