php - How to display longtext data as it is in mysql -


this might simple question can't seem find anywhere.

when store data topic or comment in database message stored in longtext, longtext shows fine in table (it shows enters , multiple spaces) when retrieve data simple code echo $commentmessage; shows data without proper enters or spaces. tried using <pre> function gives me more trouble want to.

help appreciated

use nl2br before printing records. this

echo nl2br($commentmessage); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -