douwen5546 2016-03-23 09:53
浏览 24
已采纳

PHP - 在MySQL表中存储段落

I might sound silly with simple questions . i am newbie exploring PHP , kindly help me mates.

I want to store paragraph in MySQL table .

My PHP code was

$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";

it's not storing

But, suppose if i try the following it works

$text="test";

so , i think longtext might be the issue . However in table the field type is LongText only

Kindly help me please

  • 写回答

1条回答 默认 最新

  • duanli9591 2016-03-23 11:02
    关注

    Changing

    Chetan's

    to

    Chetan\'s

    solved the issue

    thanks to @Sablefoste as this is his suggestion .

    Regarding mysqli_real_escape_string() i will try escaping the string as others advised.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 组策略中的计算机配置策略无法下发
  • ¥15 机器学习简单问题解决
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)
  • ¥50 mac mini外接显示器 画质字体模糊
  • ¥15 TLS1.2协议通信解密
  • ¥40 图书信息管理系统程序编写