How to automatically wrap long text in PHP or SQL?

Hi, I'm creating a site with a form, I'm doing it with a forum, I save comments in a database (I use MySQL), the problem is that if a user writes a text without line breaks, the message is stored in the table that way and displays the same without line breaks. I have set a size for the container but it doesn't change anything, I would like to know if there is a way to fix this issue, thank you in advance.

2 answers

  • Votes
  • Date
  • Descending date
  1. Moderator
    Normally, the browser takes care of automatically adding line breaks during display.

    --
    I mainly work in VB6 and VB.NET, with a bit of C#, but moderation often leads me to other languages.
    In VB.NET, remember to enable "Option Explicit" and "Option Strict".