PHP - 在 MySQL Table 中存储段落

PHP - Storing paragraph in MySQL Table

简单的问题可能听起来很傻。我是探索新手PHP,请各位小伙伴们多多帮助

我想将段落存储在 MySQL table .

我的 PHP 密码是

$text="This was the first book or more to say a novel, I read in my life. when I read other reviews about this book and also enquired with my friends, they were not very happy about this book but when I read this book I felt the same language which we are used to from Chetan's books, yes it is nowhere near to his works like Five Point someone or 2 States but it isn t bad either, the way he gives background to each character and ties up all the loose ends together is what I like in this book as well, it also touches a few sensitive aspects of Gujarat but also explains how they impact business and people. you will be amazed to know i Completed it in 7 days. I couldn t control my excitement of what will happen next after reading each chapter. Some good points to understand especially Indian Politics and the most its dark side political of religion and caste. Well of all I like trios book What can I say more read it and have some time of excitement of what.Surely not only sex. much about emotions. A good piece by Chetan Bhagat. --Vicky on 27 May 2015";

它没有存储

但是,假设如果我尝试以下它有效

$text="test";

所以,我认为 longtext 可能是问题所在。但是在 table 中,字段类型仅为 LongText

请帮帮我

改变

Chetan's

Chetan\'s

解决了问题

感谢@Sablefoste,这是他的建议。

关于 mysqli_real_escape_string() 我会尝试按照其他人的建议转义字符串。