Jump to content

[SOLVED] HTML Formatting from Stored Data


Apryle

Recommended Posts

I have stored text in a mysql db with html formatting.  When I look at the stored data in 'events_body' in PHPmyAdmin, it looks like:

 

<p>This is some <strong>sample text</strong>. My website is <a href="http://www.allyourssolutions.com/">All Yours Solutions</a></p>

 

I am trying to retrieve and echo 'events_body' on http://estesparkeventplanners.com/events.php using the following code:

 

<?  
$result = mysql_query("SELECT * FROM events")
or die(mysql_error());  

// store the record of the "events" table into $row
$row = mysql_fetch_array( $result );

// Print out the contents of the entry 
echo htmlspecialchars($row['events_body']); 
?>

 

If you go to http://estesparkeventplanners.com/events.php, you'll see my problem is that it's outputting as if it's straight-up text, without the HTML formatting.  I need it to interpret the HTML tags as HTML. 

 

MySQL client version: 4.1.22

php5

 

Any help is greatly appreciated.

Link to comment
https://forums.phpfreaks.com/topic/128395-solved-html-formatting-from-stored-data/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.