467,915 Members | 1,274 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,915 developers. It's quick & easy.

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')
$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'
to show the data but the data in the table is e.g. 6332 chars and I see only the 4086 chars
Oct 3 '08 #1
  • viewed: 1469
4 Replies
Expert 2GB
What's the structure of your table? Can you increase the size of your column?

-- CK
Oct 3 '08 #2
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?
Oct 3 '08 #3
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];
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'");
Oct 3 '08 #4
code green
Expert 1GB
The same thing occurs with Access data and php.
I think it is a known php bug but check this out
Oct 3 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

11 posts views Thread by badz | last post: by
7 posts views Thread by mj | last post: by
1 post views Thread by louis nguyen | last post: by
14 posts views Thread by Kukurydz | last post: by
2 posts views Thread by Papa.Coen | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.