Link to home
Start Free TrialLog in
Avatar of BR
BRFlag for Türkiye

asked on

how to select BLOB or large text from mySql database to keep break lines?

Dear Experts,
I use php and mysql.
I create an announcements page, I list here the announcements.
First I insert the announcements into my database as BLOB. Everything is fine until this part.
I check the database and BLOB ( the text ) is the same as I entered it. ( the text has the break lines )

However when I select it from my database with below code, it is comes without break lines.
What do you suggest I should do? I need the show the text on my page properly, with break lines.
Thank you

$sql = "SELECT * FROM announcements";

$result = $mysqli->query($sql);

$num = $result->num_rows;
   
if ($num > 0) {

    while($row = $result->fetch_assoc()) {
        	
	$announcements= $row["announcements"];	

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BR

ASKER

Thank you Dave Baldwin