basement Posted May 20, 2008 Share Posted May 20, 2008 I have a block of text that occasionally has some text that needs to be bolded or italicized, as well as the occasional table I have the table set up as follows: ID / Date / Title / Article where article is longtext. in that article i have {b}{/b} once in a while but when i pull the data from the table with $query="SELECT date, title, article FROM News ORDER BY date"; $result=mysql_query($query) or die(mysql_error()); $itd = $_GET["id"]; $title = htmlentities(mysql_result($result,$itd,"title")); $article = htmlentities(mysql_result($result,$itd,"article")); echo("<h1>" . $title . "</h1><br />"); echo nl2br("<p>" . $article . "</p></div>"); $num--; mysql_close($connection); i'm assuming that the nl2br is what is messing it up. possibly. i took it out and just echoed $article but that didn't work either. how can i output what is in article as html code with text instead of just a huge block of text? I hope this hasn't been asked too often. I can't find an answer anywhere. i know the security concerns of having html embedded in sql entries but i can't see any other way of doing it. i'm not gonna break up article entries each time a person wants to bold some text. hopefully someone can help. any solution whereby i can have parts of the text have different weights is useful. this forum can do it with those buttons up top but i can't figure it out. i'd love to set up a button like that actually. Quote Link to comment Share on other sites More sharing options...
Norsk.Firefox Posted May 20, 2008 Share Posted May 20, 2008 First off: Do you know what the functions you use actually does? You use htmlentities which replaces html tags like " with " and so forth. So remove htmlentities from $article = htmlentities(mysql_result($result,$itd,"article")); Quote Link to comment Share on other sites More sharing options...
basement Posted May 20, 2008 Author Share Posted May 20, 2008 god bless you norsk.firefox works perfectly now. i can't believe no one could help me with that issue. now that i've looked up what the function does it completely makes sense. teach me for copy pasting from tutorials thanks again, you've made my life much easier. Quote Link to comment 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.