Getting limited amount of data from text mysql-table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jenese
    New Member
    • Aug 2006
    • 2

    Getting limited amount of data from text mysql-table

    Hi!

    I've searched the forum and the net for the answer of, probably an easy question for the experienced....

    I need to limit the amount of text to 50 first characters when looping out the data from a mysql text-table. How and where do I attack this problem? :confused:

    Thanks! :cool:
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    How about the MySql SUBSTRING() function. As in

    Code:
    SELECT id, SUBSTRING(comment,1,20) AS b FROM tbl_name
    See MySql documentation for specifics (www.mysql.com) , such as: http://dev.mysql.com/doc/refman/4.1/en/blob.html

    Ronald :cool:

    Comment

    • jenese
      New Member
      • Aug 2006
      • 2

      #3
      Thank you it worked and helped me! As I thought... not that hard ;)

      cheers

      Comment

      Working...