Count rows to in html page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Rob (SA)
    Lieutenant Colonel

    • Nov 2006
    • 586

    #16
    Re: Count rows to in html page

    Hi,

    Thanks for all that effort.

    I have made a posting at www.gnjgf.co.za/watflip.php to veiw the result.

    Question - can I use the number created in the "Red Table" that is 103 Zwartkops to develop another table.

    What I mean is now that I have the number of entrants I want to spilt the entries into two - half to play one side of the field and the remiander naturally the other half.

    The entrants would then be sorted according to the handicap 52 on one side and 51 the other.

    there are other inputs that could have bearing on thi slittle exercise but first things first.

    Thanks for your help
    Kind Regards
    Rob
    www.gnjgf.co.za
    www.oryan-projects.com

    Comment

    • Watdaflip
      Major General

      • Sep 2005
      • 2116

      #17
      Re: Count rows to in html page

      The simplest way would be to create a page for each tournament (there are much better, more complicated ways of doing it, but I will just cover this way), that is essentially a copy of the code for the blue table. And you just change the query to be something like

      $quey1="select * from _Form_Nr_3 WHERE i_wish_to_play='label for the tourney' ORDER BY `handicap` ASC "

      Where the green is the exact value for a tournament as it will appear in the database, and the blue, is the correct column name for the players handicap in the database table

      And then change the code to have this line before the "while" loop

      $total = mysql_num_rows($query1);
      $half = round($total / 2);

      Finally change the "if" statement to redisplay the header to be something like

      if($i == $half)

      That should do it. All you have to do is create a tournament page for each of the tournaments, changing the green text above to be specific to the tourney that corresponds to the page.

      Register/Login Script
      Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

      Comment

      Working...
      X