tedrodgers wrote:
> i have a field in a sql db that holds a users news post
(varchar 500 chars
> long) ,
If you're using MySQL, the VARCHAR columns hold a maximum of
255
characters on versions prior to MySQL 5.0. Does your remote
server run
MySQL 5? If not, you need to change the column type to TEXT.
i have a box on my frontpage that
> shows the latest 5 news posts, so i need to know how to
either put the first
> 20 chars from the db field into a string to
> display in this summary box or just how to limit the
output in the box itself.
In your SQL query:
SELECT LEFT(newspost, 20) AS newspost
FROM tableName
That selects the first 20 characters. Sounds like just what
you want.
--
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/