0

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'
Saadi
  • 21
  • 1
  • 6
  • 2
    What's your current query? What's your code look like? Are there any errors? – Matt Razza Aug 10 '12 at 15:33
  • How long are we talking about here? – Madara's Ghost Aug 10 '12 at 15:33
  • "How to insert long text in mysql?" - The same way you do any other field. No way to answer this without code. – Mike B Aug 10 '12 at 15:35
  • text fields are no different than blob fields, except text fields have charset translations imposed. blobs don't. – Marc B Aug 10 '12 at 15:44
  • What you long text looks like? and what is the query you have so far? – WatsMyName Aug 10 '12 at 16:04
  • UPDATE `xxx_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=', – Saadi Aug 10 '12 at 16:08
  • `dmcontent`='€Internationalization facilities\n€Anarithmetic\nInvoking the Shell\nThe command interpreter for the Bash shell (\n)can be invoked as follows:\noptions][arguments]Bash' WHERE `id`='21'; – Saadi Aug 10 '12 at 16:08
  • I am not sure how to comment here big text. Please check my previous two comments that is the query. I have echoed the query in php and pasted in phpmyadmin and it is working. But php inserts all the field values except the long text field. – Saadi Aug 10 '12 at 16:11

0 Answers0