PDA

View Full Version : nl2br help



VonGizzle
September 9th, 2007, 01:07 PM
Hi guys,

I'm aware of the theory behind nl2br, but I can't seem to get it working within this while loop.

<?php

include("connect.php");

$showrecord = "Select * from news";
$recordC = mysql_query($showrecord,$connect);


while ($row = mysql_fetch_array($recordC, MYSQL_NUM))
{
printf("<p>%s<p>", $row[1]);
echo '<a href="news_edit.php?id='.$row[0].'">Edit</a>';
}

mysql_free_result($recordC);

mysql_close($connect);


?>

Any ideas?

simplistik
September 9th, 2007, 01:10 PM
Hi guys,

I'm aware of the theory behind nl2br, but I can't seem to get it working within this while loop.


<?php

include("connect.php");

$showrecord = "Select * from news";
$recordC = mysql_query($showrecord,$connect);


while ($row = mysql_fetch_array($recordC, MYSQL_NUM))
{
printf("<p>%s<p>", $row[1]);
echo '<a href="news_edit.php?id='.$row[0].'">Edit</a>';
}

mysql_free_result($recordC);

mysql_close($connect);


?>

Any ideas?

I don't even see it in your code... so that could explain why it's not working... also try to inclose your code in a coding tag next time, makes it easier to read.

Esherido
September 9th, 2007, 02:28 PM
Like simp said, you need to use something before you can have a problem with it.

VonGizzle
October 10th, 2007, 03:06 AM
Sorry guys I thought you might have picked up that I had obviously tried it everywhere.

Thanks anyway.