Jump to content


Photo

**SOLVED** displaying a match schedule..


  • Please log in to reply
2 replies to this topic

#1 birdie

birdie
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts
  • LocationBirmingham UK

Posted 07 April 2006 - 05:05 PM

hi, as you may have noticed i'm planning on making a match schedule. I just have one problem, i need to create a script which displays all of the matches ,which have not already started or finished, in order..

the table so far would be like this but it is flexible depending on if columns are relevant

table name: matches

id|datesched|sched_by|timesched|clan1|clan2|matchtype


i need clan1, clan 2, datesched, timesched to be echo'd.. but have no idea on how to do it ..

=============================
eg.

current time: 20:00

clan1 vs clan2 20/4/2006 21:00
clan3 vs clan4 22/4/2006 18:00

=============================

any help in any way is greatly appreciated! thankz for reading!


#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 07 April 2006 - 08:14 PM

It would be simpler to combine date and time cols into a single DATETIME type column then you could

SELECT * FROM tablename WHERE datetimesched> NOW()

As it is, you need

SELECT * FROM tablename WHERE (datesched = CURDATE() AND timesched > CURTIME() ) OR (datesched > CURDATE() )

If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 birdie

birdie
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts
  • LocationBirmingham UK

Posted 07 April 2006 - 08:45 PM

thanks!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users