Home  >  Article  >  Backend Development  >  mysql - php连接数据库查询语句中含&

mysql - php连接数据库查询语句中含&

WBOY
WBOYOriginal
2016-06-06 20:37:381102browse

在php里面用mysql_query("INSERT INTO article(title, content, author_id, time) values( '$title', '$content', $id, '$time')"'),但是$content里面有&符号,后面的内容就插不进去了,应该怎么改?

回复内容:

在php里面用mysql_query("INSERT INTO article(title, content, author_id, time) values( '$title', '$content', $id, '$time')"'),但是$content里面有&符号,后面的内容就插不进去了,应该怎么改?

我试了下&是可以做为内容直接插入的,看看你的长度是否够
mysql - php连接数据库查询语句中含&

Statement:
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