Jump to content

How can I set the limit for the data retrieved from a VARCHAR field?


brainbug

Recommended Posts

I'm trying to retrieve a record from the database (from a VARCHAR field), but I need to display only 1 line (about first 50 characters) and print it in the page. For eg. if in the varchar field in the table, data is is:-------------------------------------------------------This is W3Schools Forum. I am asking a question in the forum expecting some answers as help. Thank you for help.-------------------------------------------------------But I need to display something like:--------------------------------------------------------This is W3Schools Forum. I am asking a ..(more)--------------------------------------------------------And when the user clicks 'more', he can read the full data.How can I set a limit to how many characters are echoed in the file?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...