Apryle Posted October 14, 2008 Share Posted October 14, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/128395-solved-html-formatting-from-stored-data/ Share on other sites More sharing options...
Apryle Posted October 14, 2008 Author Share Posted October 14, 2008 I tried this without using the html_special_characters() function. html_special_characters() converts things like < to <, which is not I wanted. Quote Link to comment https://forums.phpfreaks.com/topic/128395-solved-html-formatting-from-stored-data/#findComment-665249 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.