Mark wrote:
Can anyone help me with this problem please!
the code below shows a football fixture for the entire season , round 1-22 but this takes up to much space on the webpage (very long page).
Is it possible to display one round at a time so its automatic.
At the moment- each week the admin closes a round ie: (round 2 closed) so i want the page to display round 3 fixtures only for the entire week. Can a script show the next round after the closed round (if round 1 is closed go to next round -2- if thats closed go to next round which is 3, until it gets a round thats not closed and shows the results.

The table

FIXTURES

      Field Type Null Default
      id   int(11) No
      round   char(2) No  0
      game   int(11) No  0
      date   text No
      home   text No
      away   text No
      winner   text No
      draw   text No
      closed   char(1) No  0
      comp_id   int(11) No  0
      margin   int(11) No  0



I assume 'closed' becomes '1' when it's over.


change

SELECT * FROM fixtures WHERE comp_id = $comp_id

to

SELECT * FROM fixtures WHERE comp_id = $comp_id WHERE closed='0' ORDER BY round ASC LIMIT 1;

The limit 1 will stop it fetching all rounds - if you don't want that, remove the "limit 1".

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to