duanqian2368 2011-08-31 17:36
浏览 179
已采纳

用标点符号进行长描述的MySQL类型是什么?

I'm trying to store long descriptions with symbols such as $ and punctuation. The original type I used cut the text off early. The second type I used outputs the following...

"  Tickets are $13.00 for adults, $11.00 for seniors, $5.00 for children ages 5-11 and free for children under 5.  There is also a family rate of $35.00 available for 2 adults and up to 4 children. All prices include taxes.  Reservations are recommended. Please call            519-661-5000       or             1-800-265-2602       for reservations."

Is there a type I can use to avoid this? Or will I have to convert punctuation before I put it into the database?

The types I've tried are Varchar & Mediumtext.

EDIT: Size problem has been solved but still getting the 'Â Â ' characters.

  • 写回答

2条回答 默认 最新

  • dongwu5318 2011-08-31 17:38
    关注

    Use the TEXT type. It can hold up to 65KB.

    If you use the proper encoding (like UTF-8), there is no problem in storing puncturation characters.

    You can also use MEDIUMTEXT or LONGTEXT if you need to store up to 16MB or 4GB in the field.

    See MySQL data type storage requirement

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥100 数字取证课程 关于FAT文件系统的操作
  • ¥15 如何使用js实现打印时每页设置统一的标题
  • ¥15 安装TIA PortalV15.1报错
  • ¥15 能把水桶搬到饮水机的机械设计
  • ¥15 Android Studio中如何把H5逻辑放在Assets 文件夹中以实现将h5代码打包为apk
  • ¥15 使用小程序wx.createWebAudioContext()开发节拍器
  • ¥15 关于#爬虫#的问题:请问HMDB代谢物爬虫的那个工具可以提供一下吗
  • ¥15 vue3+electron打包获取本地视频属性,文件夹里面有ffprobe.exe 文件还会报错这是什么原因呢?
  • ¥20 用51单片机控制急停。
  • ¥15 孟德尔随机化结果不一致