Counting Referral Contest MYSQL/PHP Problem

I'm creating a referral contest for my site
Now i need it to stop counting referrals on the contest page when i reached 1000members in total



I have created a config file with de code below in

Code:
$end = 1000;


The conest.php file is selecting the top 10 referrals like i want it
But now i dont know wich code i need to add to stop counting
Anyone can help me?

The contest.php file

<? include("header.php");?>
<table width="85%" border="0" cellspacing="5" cellpadding="5" align="center">
<tr>
<td>
<p align="center"><font size="2"><br>
</font><b>Contests</b><font size="2"><br>
<br>
</font></p>
<p><font size="2"><b>Below are the current contests:</b></font></p>
<p><font face="Arial" size="2">- Referral contest<br>
<table>
<tr>
<th>Username</th>
<th>Referrals</th>
<th></th>
<th></th>
</tr>
<?

require ('config.php');

$tablaaa = mysql_query("SELECT * FROM tb_users ORDER BY referals DESC LIMIT 10");

while ($registroe = mysql_fetch_array($tablaaa)) {

echo "
<tr>
<td>". $registroe["username"] ."</td>
<td>". $registroe["referals"] ."</td>
<td>";


}
?>&nbsp;</font></p>
<p>
<font size="2"><br>
<br>
</font>
</p>
<hr align="left">
&nbsp;</td>
</tr>
</table>
<? include("footer.php");?>


Now what do i need to add to stop mysql count on the amount i setup in the config file?

Share this

Related Posts

There was an error in this gadget