一个php连接数据库问题,不知道怎么回事?

WBOY
Release: 2016-06-20 12:30:25
Original
904 people have browsed it

mysql_query("insert into ren (xingming,id) value ("h","1");");
就是这段代码,代表向表中插入数据,可是始终是错误,不能通过编译?
提示:Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\new1.php on line 29
我不知道这一段有什么错误??


回复讨论(解决方案)

mysql_query("insert into ren (xingming,id) value ('h','1');");

我很奇怪?为什么那里不能用双引号?是什么原因?在mysql里面那句语句都能通过?

双引号中出现了双引号,你说哪个双引号是字符串的结束呢?

外面有双引号了,里面还用双引号,php语法通不过。

应该去看看单引号和双引号的区别啊,不过通常这些都不会这样写的吧,

知道了,谢谢大家了!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!