Hi Guys,
I have made changes like this
PHP Code:
<tr class="alt2">
<td>GLENDOWER</td>
<td>27 FEBRUARY 2011</td>
<td>?</td>
<?php
// name of tournament you wish to count entries from
// maybe from a form entry?
$tournament = 'GLENDOWER - 27/02/2011';
// count the total entries with that tournament name
$c = mysql_query ("SELECT count (*) from `_Form_Nr_4` WHERE `I_wish_to_play` = '$tournament'");
// set "open" or "closed" based on that number
$openORclosed = $c >= 80 ? 'Closed' : 'Open';
<td><form action="https://www.payfast.co.za/eng/process" method="post">
<input type="hidden" name="cmd" value="_paynow">
<input type="hidden" name="receiver" value="junior@hayesgolf.co.za">
<input type="hidden" name="item_name" value="Payment - Glendower - Glacier Series">
<input type="hidden" name="item_description" value="payment">
<input type="hidden" name="amount" value="120.00">
<input type="hidden" name="return_url" value="http://www.gnjgf.co.za/entryform.php">
<input type="hidden" name="cancel_url" value="http://www.gnjgf.co.za/Glacier_Main.html">
<input type="submit" style="width:66px;height:20px;background-color:#B5CCE4;font-size:10px; font-family: arial, sans-serif;" value="PAY NOW">
</td>
';
?>
</tr>
and it has no effect other than produce a White screen.
However if I do the following , I am closer to achieving my desired result.
PHP Code:
<tr class="alt2">
<td>GLENDOWER</td>
<td>27 FEBRUARY 2011</td>
<td>?</td>
<?php
// name of tournament you wish to count entries from
// maybe from a form entry?
$tournament = 'GLENDOWER - 27/02/2011';
// count the total entries with that tournament name
$c = mysql_query ("SELECT count (*) from `_Form_Nr_4` WHERE `I_wish_to_play` = '$tournament'");
if($num_rows <= 13){
echo '<td><font style="font-size:11px" color="Red" face="Arial">CLOSED</td>
<td> </td>';
}
else {
echo '<td><b><font style="font-size:11px" color="Blue" face="Arial">OPEN</b></td>
<td><form action="https://www.payfast.co.za/eng/process" method="post">
<input type="hidden" name="cmd" value="_paynow">
<input type="hidden" name="receiver" value="junior@hayesgolf.co.za">
<input type="hidden" name="item_name" value="Payment - Glendower - Glacier Series">
<input type="hidden" name="item_description" value="payment">
<input type="hidden" name="amount" value="120.00">
<input type="hidden" name="return_url" value="http://www.gnjgf.co.za/entryform.php">
<input type="hidden" name="cancel_url" value="http://www.gnjgf.co.za/Glacier_Main.html">
<input type="submit" style="width:66px;height:20px;background-color:#B5CCE4;font-size:10px; font-family: arial, sans-serif;" value="PAY NOW">
</td>
';
}
?>
</tr>
If I change the value in the later case of 13 to 80 then the counting function does not seem to work.
I have changed the value of 80 to 13 in this instance as I have already loaded 12 members. Giving me a live sample to work with.
I have also put the 'tournament' name as it appears in the database under the field 'I_wish_to_play'
It would be great if you guys can see what is the difference and advise?
Regards
Rob
Bookmarks