By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,419 Members | 1,609 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,419 IT Pros & Developers. It's quick & easy.

Strore large texts in mssql and dispaying them in php

P: 200
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
Share this Question
Share on Google+
4 Replies

Expert 2.5K+
P: 2,878
What's the structure of your table? Can you increase the size of your column?

-- CK
Oct 3 '08 #2

P: 200
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

P: 200
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 100+
P: 1,726
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.