i have an error on Comments when i add a comm to TORR id 444 is making comment to a recomanded torrent randon from this code ! i had changed the Torrents.id='$id' with torrents.id='$torx' but the same error
What i shoud change to stop the interferance ?
COMMENT
What i shoud change to stop the interferance ?
//===| Start Recommended Torrents |===//
begin_frame(T_("Recommended"));
$rec = mysql_query("SELECT id, name, added, image1, seeders, leechers, times_completed FROM torrents WHERE banned ='no' AND visible='yes' AND recommendedx='yes' ORDER BY RAND() LIMIT 5");
if (mysql_num_rows($rec) > 0) {
print("<tr>");
while ($row2 = mysql_fetch_array($rec)) {
$torx = $row2['0'];
$altname = $row2['1'];
$where = "WHERE banned = 'no' AND visible='yes' AND torrents.id='$torx'";
$res = mysql_query("SELECT torrents.id, torrents.image1, torrents.image2, torrents.added, torrents.added, torrents.seeders, torrents.leechers, torrents.times_completed, categories.name AS cat_name FROM torrents LEFT JOIN categories ON torrents.category = categories.id $where");
$row = mysql_fetch_array($res);
$cat = $row['cat_name'];
$img1 = "<a href=file.php?id=$torx target='_new'><div><img id='cover_img1' class='cover_img' border='0' src='uploads/images/$row[image1]' title=\"$altname | $cat\" width='210px' height='330px'></a></div>
<div style='margin-top:10px; font-size:13px;'>
<img src=images/check.png height='14' title='Completed' border=0><font color=#0080FF> <b>".$row['times_completed']."</b></font> |
<img src=images/arrow_up.gif height='12' title='Seeders' border=0><font color=#00AA00><b>".$row['seeders']."</b></font> |
<img src=images/arrow_down.gif height='12' title='Leechers' border=0><font color=#FF0000> <b>".$row['leechers']."</b></font>
</div>";
if ($row["image1"] != ""){
print("<td align=center>".$img1."</td>");
}else{
$img1 = "<a href=file.php?id=$torx><img id='cover_img1' class='cover_img' border='0' src='/pic/uploadimage.jpg' title=\"$altname | $cat\" width='90px' height='130px'></a>
<div style='margin-top:10px; font-size:13px;'>
<img src=images/check.png height='14' title='Completed' border=0><font color=#0080FF> <b>".$row['times_completed']."</b></font> |
<img src=images/arrow_up.gif height='12' title='Seeders' border=0><font color=#00AA00><b>".$row['seeders']."</b></font> |
<img src=images/arrow_down.gif height='12' title='Leechers' border=0><font color=#FF0000> <b>".$row['leechers']."</b></font>
</div>";
print("<td align=center>".$img1."</td>");
}
}
print("</tr>");
}
end_frame();end_frame();
//===| |===//COMMENT
$subres = mysql_query("SELECT COUNT(*) FROM comments WHERE torrent = $id") or die(mysql_error());
$subrow = mysql_fetch_array($subres);
$commcount = $subrow[0];
if ($commcount) {
list($pagertop, $pagerbottom, $limit) = pager(10, $commcount, "file.php?id=$id&");
$commquery = "SELECT comments.id, text, user, comments.added, avatar, signature, username, title, class, uploaded, downloaded, privacy, donated FROM comments LEFT JOIN users ON comments.user = users.id WHERE torrent = $id ORDER BY comments.id $limit";
$commres = mysql_query($commquery) or die(mysql_error());
}else{
unset($commres);
}
if ($commcount) {
print($pagertop);
commenttable($commres);
}else {
}
require_once("backend/bbcode.php");
if ($CURUSER) {
echo "<CENTER><div id='myDIVx'>";
echo "<form name=\"comment\" method=\"post\" action=\"file.php?id=$row[id]&takecomment=yes\">";
echo "".textbbcode("comment","body")."<br>";
echo "<input type=\"submit\" class=btn value=\"".T_("ADD")."\" />";
echo "</form></div></CENTER>";
}
end_frame();end_frame();