简体   繁体   English

将文本从textarea插入mysql表

[英]Inserting text from textarea to mysql table

I have a form with a textarea field. 我有一个带有textarea字段的表格。 When i add some html code. 当我添加一些html代码时。 It's inserting into the table properly but with extra slashes. 它已正确插入表中,但带有多余的斜杠。 Before inserting the code i used the mysql_real_escape_string function and stipslashes function. 在插入代码之前,我使用了mysql_real_escape_string函数和stipslashes函数。 But still no use. 但是还是没用。 The data adding with the slashes. 数据加上斜杠。 What's the problem ? 有什么问题 ? Is i have to use any other functions?? 我还必须使用其他功能吗?

You should use stripslashes() when you are reading from the database. 从数据库中读取数据时,应使用stripslashes()

Maybe you have magic_quotes_gpc on, please paste some code. 也许您启用了magic_quotes_gpc,请粘贴一些代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM