Strore large texts in mssql and dispaying them in php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mikek12004
    New Member
    • Sep 2008
    • 200

    Strore large texts in mssql and dispaying them in php

    I have a text field where I wish to enter a large text around 8000 words and a div where I want to diplay it.
    To save I have a textarea with post I gaet the text and save it using a simple
    Code:
    insert into clroot.descriptions (desc) values ('$text')
    $test is the PHP variable holding the text.
    Storing is OK but when displaying It cuts me also some chahracters I use
    Code:
    select CONVERT(TEXT,descr1) from clroot.descriptions where id='1.00930'
    to show the data but the data in the table is e.g. 6332 chars and I see only the 4086 chars
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    What's the structure of your table? Can you increase the size of your column?

    -- CK

    Comment

    • mikek12004
      New Member
      • Sep 2008
      • 200

      #3
      id varchar(50)
      desc1 varchar(8000)
      desc2 varchar(8000)
      desc3 varchar(8000)

      in this table I want to store/display the biggest text possible what should I put to the column type? And will I have problems displaying in php?

      Comment

      • mikek12004
        New Member
        • Sep 2008
        • 200

        #4
        I indded have a problem displaying them in PHP, when I use
        Code:
        $ree=mssql_query("select descr1 from clroot.descriptions where id='1.00930'");
        echo $ree[0];
        even though the descr1 is a column with TEXT type when I do the echo I get a very trimmed version of the text.
        The same result I have with
        Code:
        $ree=mssql_query("select CONVERT(TEXT,descr1) from clroot.descriptions where id='1.00930'");

        Comment

        • code green
          Recognized Expert Top Contributor
          • Mar 2007
          • 1726

          #5
          The same thing occurs with Access data and php.
          I think it is a known php bug but check this out
          manual

          Comment

          Working...