I have a problem... I mean it looks good, but It's erroring up...?
while($row = mysql_fetch_array($result))
{
$fav = 0;
$stop = 0;
$id = $row['id'];
$title = mysql_escape_string($row['title']);
$body = stripcslashes(nl2br(mysql_escape_string($row['body'])));
$time = date("n.j.Y", $row['timestamp']);
$result1 = mysql_query("SELECT * FROM favoriteposts WHERE ip='".$_SERVER['REMOTE_ADDR']."' ORDER BY blogid DESC") or die(mysql_error()."<br><br>Please send the text above to an admin who can fix the problem!");
while($row1 = mysql_fetch_array($result1)) {
if($stop == 1) {
if($id == $row1['blogid']) {
$fav = 1;
$stop = 1;
} else {
$fav = 0;
}
}
}
echo "
<article>
<h1><a href='?id=".$row['id']."'>".$title."</a></h1>
<span class='date'>".$time."</span>
<p id='articlebody'>".$body." fav = ".$fav."<br>
<a href='?id=".$row['id']."'>View Post</a>";
if($fav == 1) {
echo "<a style='margin-left:20px;' href='?fav=".$row['id']."'>Unfavorite Post</a>";
}
if($fav == 0) {
echo "<a style='margin-left:20px;' href='?fav=".$row['id']."'>Favorite Post</a>";
}
echo "</p><br>
</article><br><br>".$fav."
";
}