Format output from mysql table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jjeanj1
    New Member
    • May 2007
    • 18

    Format output from mysql table

    I have a an issue that's been bothering me. I have a a table with some data. This is my table format.

    id
    title
    content ( where content is coming from a form). the content can be a long string
    like that:

    d0whgfhsd dfsadifufsadhos g fogaosdhfosadhg fsdojgofhvoashf g sfojgvhsofdhgvo asf

    how do i display that content in a formated way. For example

    d0whgfhsd dfsadifufsadhos g fogaosdhfosadhg
    fsdojgofhvoashf g sfojgvhsofdhgvo asf

    The reason why i need to do this is because if someone put a hurge article in the content, when i display the content on my page it's A LONG STRING OF CONTENT. I don't want that. it's messing up my webpage. Any help would be appreciated.
  • mohaakilla51
    New Member
    • Jul 2007
    • 39

    #2
    just tell it to display in a <div> with a specified width... (and make sure to have a doctype :P)

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      [code=php]
      //doctype n such up here..

      <div style=\"width: <!-- set width //-->\">
      <?php
      // code for outputting stuff from table here
      ?>
      </div>
      [/code]

      Wasn't so hard was it :D

      Comment

      Working...