Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old October 3rd, 2008, 08:17 AM
Member
 
Join Date: Sep 2008
Posts: 52
Default 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
Expand|Select|Wrap|Line Numbers
  1. insert into clroot.descriptions (desc) values ('$text')
  2.  
$test is the PHP variable holding the text.
Storing is OK but when displaying It cuts me also some chahracters I use
Expand|Select|Wrap|Line Numbers
  1. select CONVERT(TEXT,descr1) from clroot.descriptions where id='1.00930'
  2.  
to show the data but the data in the table is e.g. 6332 chars and I see only the 4086 chars
Reply
  #2  
Old October 3rd, 2008, 09:05 AM
ck9663's Avatar
Expert
 
Join Date: Jun 2007
Posts: 1,512
Default

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

-- CK
Reply
  #3  
Old October 3rd, 2008, 09:28 AM
Member
 
Join Date: Sep 2008
Posts: 52
Default

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?
Reply
  #4  
Old October 3rd, 2008, 10:25 AM
Member
 
Join Date: Sep 2008
Posts: 52
Default

I indded have a problem displaying them in PHP, when I use
Expand|Select|Wrap|Line Numbers
  1. $ree=mssql_query("select descr1 from clroot.descriptions where id='1.00930'");
  2. echo $ree[0];
  3.  
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
Expand|Select|Wrap|Line Numbers
  1. $ree=mssql_query("select CONVERT(TEXT,descr1) from clroot.descriptions where id='1.00930'");
Reply
  #5  
Old October 3rd, 2008, 12:55 PM
code green's Avatar
Expert
 
Join Date: Mar 2007
Posts: 839
Default

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

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles