I have never had so many problems with a simple little PHP comment script in my life.
But, maybe I'm just having a bad week.
Heres the problem:
And the script:
Any help?PHP Code:<?php
}
$tbl_name2 = "CENSORED";
$sql2 = "SELECT * FROM $tbl_name2 WHERE CENSORED='$id'";
$result2 = mysql_query($sql2);
while($rows = mysql_fetch_array($result2)){
?>
<div style="margin-top: 10px; margin-bottom: 10px; border: 1px solid #666; -moz-border-radius: 5px; -webkit-border-radius: 5px; padding: 5px;">
<strong><a href="<?=$rows['a_web']?>"><?=$rows['a_name']?></a></strong> <small>said:</small>
<p>
<?=$rows['a_answer']?>
</p>
<small><span style="font-family: georgia; color: #666">Posted on <?=$rows['a_datetime']?></span></small>
</div>
<?php
}
$sql3 = "SELECT view FROM $tbl_name WHERE id='$id'";
$result3 = mysql_query($sql3);
$rows = mysql_fetch_array($result3);
$view = $rows['view'];
if(empty($view)){
$view = 1;
$sql4 = "INSERT INTO $tbl_name(view) VALUES('$view') WHERE id='$id'";
$result4 = mysql_query($sql4);
}
$addview = $view+1;
$sql5 = "update $tbl_name set view='$addview' WHERE id='$id'";
$result5 = mysql_query($sql5);
mysql_close();
?>![]()




Reply With Quote


Bookmarks