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

mikek12004
100+
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
Oct 3 '08 #1
  • viewed: 1469
Share:
4 Replies
ck9663
Expert 2GB
What's the structure of your table? Can you increase the size of your column?

-- CK
Oct 3 '08 #2
mikek12004
100+
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
mikek12004
100+
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'");
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
manual
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.