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 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)