Jump to content

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


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?

Edited by BrainBUG
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...