How to insert long text in Mysql database (“Text” Datatype) using PHP

旧巷老猫 提交于 2019-12-12 05:12:25

问题


I am trying to insert long text into a mysql database using PHP. I am using data type "Text" for storing long text, but the problem is that "Text" data type is not storing the value, but if I use "Blob" instead of "Text", it works.

One thing I would like to add: if I run the query in the phpmyadmin directly, it is working. So it seems that php can't insert the data into the database for "Text" data type. I googled this problem, but yet no solution found. Can anybody please guide me how to fix it ? Thanks in advance.

Table type: MyISAM

UPDATE `xx_tablename` SET `catid`='1',`dmname`='bash Quick Reference 2006',`dmfilename`='bash Quick Reference 2006.pdf',`dmdescription`='',`dmdate_published`='2012-08-10 14:48:14',`dmowner`='0',`published`='0',`dmurl`='',`dmcounter`='0',`checked_out`='54',`checked_out_time`='2012-08-10 15:54:05',`approved`='0',`dmthumbnail`='',`dmlastupdateon`='2012-08-10 15:59:51',`dmlastupdateby`='54',`dmsubmitedby`='54',`dmmantainedby`='54',`dmlicense_id`='0',`dmlicense_display`='0',`access`='1',`attribs`='crc_checksum=\nmd5_checksum=',`dmcontent`='€Internationalization facilities\n€Anarithmetic\nInvoking the Shell\nThe command interpreter for the Bash shell (\n)can be invoked as follows:\noptions][arguments]Bash can execute commands from a terminal, from a “le (when the “rst\nor from standardinput (if no arguments remain or if\nprints prompts if standardinput is a terminal, or if\nis given on the command line.\nOn many systems,\nis a link to Bash. When invoked as\n,Bash acts morelike the\ntraditional Bourne shell: login shells read\n,and regular\nshells read $ENV,ifitsset. Full details areavailable in the\nRead commands from string\n--dump-strings\nPrint all\nstrings in the program.\nCreate an interactiveshell (prompt for input).\nEnable\nStar tup as a privileged user.Dont read $ENV or $BASH_ENV,dont impor tfunctions\nfrom the environment, and ignorethe value of $SHELLOPTS. Thenormal “xed-\nname startup “les (such as\n)are read.\n--restricted\nCreate a restricted shell.\nRead commands ffunctions\nUnset variables\nUntil\ncommand. See the Examples under\nID]Pause in execution until all background jobs complete (exit status 0 is\nreturned), or pause until the speci“ed background process\nis returned). Note that the shell variable\nthe process ID of the most recent background process.\nExample\nWait for most recent background process to finish\nBuilt-in Commands63\n' WHERE `id`='21'

来源:https://stackoverflow.com/questions/11904866/how-to-insert-long-text-in-mysql-database-text-datatype-using-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!