I have a query that gives me the number of occurrences using a count, see below:
$query = "SELECT COUNT(a.market_id) AS winners, a.winner,
a.twitter_pubstatus, a.market, a.racetime, a.racecourse, b.course, b.horse,
b.type, b.racetime FROM results a INNER JOIN bets b ON a.racecourse = b.course
WHERE a.twitter_pubstatus = 0 AND a.market = '$win' AND
b.type = '$userwin' AND a.winner = b.horse;";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);
$checkWinners = $row['winners'];
echo $checkWinners;
This for example will return 11. I now have an IF statement:
<?php if ($checkWinners > 1) { ?>
DO THIS
<? } else { ?>
DO THIS INSTEAD
<? } ?>
Now it runs through this once and that's fine. I want it to loop through so, 11 then goes through the first bit then need it will be 10 and go through until it hits 0 and then stop.
How to do this? While Loop? Help Appreciated