im trying to make a image voting page where the users can check to see like a top 5 or 10 .. right now its posting EVERY image thats been made.. how do i get just a certain amount back? im stumped on this one..
heres what i got so far..
<html><head><title>Admin</title>
</head><body bgcolor="#000000" text="#FFFFFF">
<SCRIPT LANGUAGE="JavaScript" src="/click.js"></script>
<STYLE TYPE="text/css">
<!--@import url(../vote.css);-->
</STYLE>
<br><br>
<blockquote><blockquote>
<?
include("../config.php3");
include("../prep.php3");
$connection = mysql_pconnect(SQL_SERVER, SQL_UID, SQL_PWD);
mysql_select_db("vote", $connection);
$reportops = Array("voteavg", "votecount", "sex", "bonks");
$reports = Array("Results", "Total Votes", "Top Sex", "Reported");
$reportsql = Array(
"select from user where blocked=0 order by active desc, voteaverage desc, votecount desc",
"select from user where blocked=0 order by active desc, votecount desc",
"select from user where blocked=0 order by active desc, sex, voteaverage desc, votecount desc",
"select from user where blocked=0 order by active desc, bonks desc");
$report = 0;
for ($i=0; $i<sizeof($reportops); $i++)
if ($op == $reportops[$i]) $report = $i;
for ($i=0; $i<sizeof($reportops); $i++)
{
if ($report != $i) {
print "[<a href=\"./?op=" . $reportops[$i] . "\">" .
$reports[$i] . "</a>] ";
} else {
print "[<b>" . $reports[$i] . "</b>] ";
$sql = $reportsql[$i];
}
}
print "<br><br>\n\n";
$query = mysql_query($sql);
$rows = mysql_num_rows($query);
for ($i = 0; $i < $rows; $i++)
{
$record = mysql_fetch_array($query);
print "<a href=\"../?id=" . id2code($record["id"]) . "\">";
print "<img src=\"" . $record["picurl"] . "\" heigth=\"50\" width=\"50\" border=0></img></a> |";
print " Results =" . $record["voteaverage"] . "% |";
print " Total Votes=" . $record["votecount"] . " |";
print " Reported=" . $record["bonks"] . " |";
if ( ($record["bonks"] >= ($record["votecount"] / 2)) && ($record["bonks"] > 0) )
print "<b>!!!!!!</b>";
if ($record["active"]==0)
print " <i>INACTIVE</i>";
print "<br><br>\n";
}
?>
<hr></blockquote></blockquote>
</body></html>
where and what do i change/add to do this?? if you got any suggestions, please let me know