hi there
i have functions below that used to count replies on specific thread/message
the replies function is embedded in the adminpagination function...it worked fine though, but an error occured as follows:Code://funtion for pagination function adminpagination() { $display = 10; if (isset($_GET['np'])) { $num_pages = $_GET['np']; } else { $query = "SELECT * FROM posts"; $query_result = mysql_query ($query); $num_records = @mysql_num_rows ($query_result); if ($num_records > $display) { $num_pages = ceil ($num_records/$display); } else { $num_pages = 1; } } if (isset($_GET['s'])) { $start = $_GET['s']; } else { $start = 0; } // Make the query. $query = "SELECT DATE_FORMAT(postupdate, '%M %D, %Y - %l:%i %p'), title, postID, firstname FROM posts AS p, users AS u WHERE p.userID = u.userID ORDER BY postupdate DESC LIMIT $start, $display"; $result = @mysql_query ($query); $num = mysql_num_rows ($result); if ($num > 0) { if ($num_pages > 1) { $current_page = ($start/$display) + 1; if ($current_page != 1) { echo '<a href="report.php?s=' . ($start - $display) . '&np=' . $num_pages . '" class=under>Previous</a> '; } for ($i = 1; $i <= $num_pages; $i++) { if ($i != $current_page) { echo '<a href="report.php?s=' . (($display * ($i - 1))) . '&np=' . $num_pages . '" class=under>' . $i . '</a> '; } else { echo $i . ' '; } } if ($current_page != $num_pages) { echo '<a href="report.php?s=' . ($start + $display) . '&np=' . $num_pages . '" class=under>Next</a>'; } } echo "<tr align=center class=tablehead><td width=20% class=tableborder><table><tr><td><b>NAME</b></td></tr></table></td> <td width=50% class=tableborder><table><tr><td><b>TOPIC</b></td></tr></table></td> <td width=10% class=tableborder><table><tr><td><b>REPLIES</b></td></tr></table></td> <td width=20% class=tableborder><table><tr><td><b>DATE</b></td></tr></table></td></tr>"; while ($row = mysql_fetch_array($result, MYSQL_NUM)) { //puta $row[0] = '<font size=1>'.$row[0].'</font>'; echo "<tr><td width=20% class=tableborder align=center><table><tr><td><b><a href=\"\" class=\"under\">".strtolower($row[3])."</a><b></td></tr></table></td> <td width=50% class=tableborder><table><tr><td><a href=\"reportview.php?pid={$row[2]}\" class=\"under\" style=\"font-weight: bold;\">$row[1]</a></td></tr></table></td> <td width=10% class=tableborder align=center><table><tr><td>".replies(floor($row[2]))."</td></tr></table></td> <td width=20% class=tableborder><table><tr><td>$row[0]</td></tr></table></td></tr>"; } mysql_free_result ($result); } else { echo '<h3>There are no records to show.</h3>'; } mysql_close(); } //replies function function replies($postID) { $rcQuery = "SELECT count(postID) AS rowcount FROM comments WHERE postID=$postID"; $rcResult = @mysql_query($rcQuery); if ($rcResult) { return (@mysql_result($rcResult,0,'rowcount')); } else { die("Error with $rcQuery"); } }
the code in line 321 is thisWarning: Missing argument 1 for replies() in Warning: Missing argument 1 for replies() in c:\inetpub\wwwroot\mysample\functions\library.php on line 321
Error with SELECT count(postID) AS rowcount FROM comments WHERE postID=
now, where could be the problematic area??Code:function replies($postID)
thanks






Bookmarks