ok ive got this functions in an include file:
and ive got this piece of code in a script:PHP Code:// comments()
function comments() {
$result = mysql_query("SELECT * FROM comments WHERE entry = '$id'");
$number = mysql_num_rows($result);
if ($number == "0") {
echo ("<a href=comment.php?action=add&id=$id>Add Comment</a>");
}
elseif ($number == "1") {
echo ("<a href=comment.php?id=$row[id]>1 comment | <a href=comment.php?action=add&id=$id>Add Comment</a>");
}
else {
echo ("<a href=comment.php?id=$row[id]>$number comments | <a href=comment.php?action=add&id=$id>Add Comment</a>");
}
}
but for some reason when i goto click on one of the links to add a comment the URL is http://www.cheeseblind.f2s.com/cheeseblind/comment.php?action=add&id= but it should have the id number on the end but it doesnt.PHP Code:// list entries
$result = mysql_query("SELECT * FROM entries ORDER BY id DESC LIMIT 10");
while ( $row = mysql_fetch_array($result) ) {
$id = $row[id];
echo ("
<table width=500 border=1 cellspacing=0 cellpadding=3 bordercolor=#000000>
<tr>
<td bgcolor=#000000>
<table width=100% border=0 cellspacing=0 cellpadding=0>
<tr>
<td></td>
<td>
<div align=right><font color=#FFFFFF>[ $row[date] | $row[time] ]</font></div>
</td>
</tr>
</table>
<div></div>
</td>
</tr>
<tr>
<td bgcolor=#FFFFFF>
<table width=100% border=0 cellspacing=1 cellpadding=1>
<tr>
<td>$row[entry]</td>
</tr>
<tr>
<td>
<div align=right>
");
comments();
echo("
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
");
}
Anyone know why?





Bookmarks