displaying text from sql db via syntax highlighter issue

Hey im stuck on an issue with displaying text from an sql table into a syntax highlighter, the issue i have is that the line is breaking and not using the full width. It does use the width if i use normal characters, but with code it keep line breaking inplaces it shouldnt be. Im wondering if perhaps i need to change something on how the text is echo’d from the sql.

you can see with normal text the width is fine: http://www.hushmag.co.uk/code/a_Snip.php?snipid=17

but with some source it displays like this: (line breaking at the wrong point on each line) http://www.hushmag.co.uk/code/a_Snip.php?snipid=19

On the inputting form to the db i use addslashes to allow the addition chars [php]$snipcontent = addslashes($_POST[‘snipcontent’]);[/php]
i wonder if i am supposed to use something else for now displaying from the sql??

The syntax highlighter here is denoted within the

.body1 {

height: auto;
width: 1000px;
margin-left: auto;
margin-right: auto;

<? session_start(); $snipid = $_GET['snipid']; $user = $_SESSION['username']; // Connects to Database mysql_connect("localhost", "xxxx", "xxxx") or die(mysql_error()); mysql_select_db("xxxx") or die(mysql_error()); $data = mysql_query("SELECT * FROM code_lib WHERE snip_id = $snipid") or die(mysql_error()); //gets data and places into variable while($info = mysql_fetch_array( $data )) { $sniptitle = "".$info['snip_title'] ."" ; $snipcontent = "".$info['snip_content'] ."" ; $postedby = "".$info['posted_by'] ."" ; $lang = "".$info['lang'] ."" ; $datetime = "".$info['datetime'] ."" ; } ?>

<? echo $sniptitle ?>

Posted by <? echo $postedby ?>

Tags tag1, tag2, tag3

Posted: <? echo $datetime ?>


Any help much appreciated



solved by using

$snipcontent = addslashes($_POST[‘snipcontent’]);

Sponsor our Newsletter | Privacy Policy | Terms of Service