PDA

View Full Version : Showing dates that have been, and future dates


tomlewis
10-23-2005, 12:49 PM
I want to show matches that have been, and that haven't been played using PHP and MySql.

What kind of query would I need?

Creative Insanity
10-23-2005, 06:00 PM
A little more info please.

ramandeep
10-23-2005, 09:25 PM
I have seen lots of matches between PHP and MySQL teams but can't figure out bout this one!

Kidding :D

can you please give bit more details of ur question?

Creative Insanity
10-23-2005, 10:54 PM
All you need to know about dates ('http://php.inspire.net.nz/manual/en/function.date.php')

davidj
10-24-2005, 10:02 AM
I want to show matches that have been, and that haven't been played using PHP and MySql.


you will have a flag field in db that should register played games (1) any future unplayed games this field should be blank or 0 (zero )

just write your query ..

select * from table where field = '0' // not played
select * from table where field = '1' // played

tomlewis
10-25-2005, 10:56 AM
So how do I show a field is not 0. If I use -1 in the homescore field for games that haven't been played, and use the actualy score in the homescore field, how do I select fields that aren't -1?

davidj
10-25-2005, 11:00 AM
// IS NOT 0
select * from table where field != '0'


<span style='font-size:12pt;line-height:100%'>!= </span> represents IS NOT


//IS NOT 1
select * from table where field != '1'