Jump to content

Row Count Not Working Or Showing


Rob (SA)
 Share

Recommended Posts

Hi Folks, I have a page that is not funtioning properly I would like the entries in MySQL to be counted under a specific event and then the number of entries for the specific event show in the respective column "Total entered" I have provided some html of what is generally written with the hope someone can add value.

<html><head><style type="text/css">#customers{font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;width:100%;border-collapse:collapse;}#customers td, #customers th{font-size:0.7em;border:3px solid #FFFFFF;padding:3px 7px 2px 7px;}#customers th{font-size:0.7em;text-align:left;padding-top:2px;padding-bottom:2px;background-color:#376091;color:#ffffff;}#customers tr.alt td{color:#000000;background-color:#B5CCE4;}#customers tr.alt2 td{color:#000000;background-color:#95B3D7;}</style></head><body><table id="customers"><tr class="th"><td> </td><div><font style="font-size:16px" color="#5A6A83" face="Arial">UPCOMING TOURNAMENTS ARE LISTED BELOW</font></div></button></div></td><td> </td></tr><tr>  <th>GOLF COURSE</th>  <th>DAY</th>  <th>DATE</th>  <th>TOTAL ENTERED</th>  <th>ENTRY STATUS</th>  <th>ENTER</th></tr><tr class="alt"><td>HETTIE ELS</td><td>KEMPTON PARK GC</td><td>05 JANUARY 2011</td><?php//call the function that will count the entries for us$tournament="KEMPTON PARK GC - 05/01/2011";$num_rows=count_entries("$tournament");?><td>WEDNESDAY</td><td><?php echo $num_rows; ?></td><?phpif($num_rows >= 96){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 - Kempton Park - 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>';}?>   

Link to comment
Share on other sites

Hi , I thought this information does the work of counting

<?php //call the function that will count the entries for us $tournament="KEMPTON PARK GC - 05/01/2011"; $num_rows=count_entries("$tournament"); ?>
In that it would search for the data in a field in MySQL matching "Kempton Park . . . . " and count only the matching values. I am not a programmer so I go on anothers lead Thanks for your replies
Link to comment
Share on other sites

You need to remove the quotes around the variable name, but other than that the syntax is fine. If it returns a blank value then something in the count_entries function is wrong or the value that you're passing to it isn't found in the database. That function is not built into PHP, it's a custom function that someone else wrote.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...