如何使用PHP在Mysql数据库中插入长文本(“文本”数据类型)

时间:2012-08-10 15:31:34

标签: php mysql longtext

我正在尝试使用PHP将长文本插入到mysql数据库中。我使用数据类型“文本”来存储长文本,但问题是“文本”数据类型不存储值,但如果我使用“Blob”而不是“Text”,它可以工作。

我想补充一点:如果我直接在phpmyadmin中运行查询,它就可以了。因此,似乎php无法将数据插入数据库中以获取“Text”数据类型。我搜索了这个问题,但还没有找到解决方案。任何人都可以指导我如何解决它?提前谢谢。

表格类型: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'

0 个答案:

没有答案