We help IT Professionals succeed at work.
Get Started

how can i compare dates in php

amchugh89
amchugh89 asked
on
373 Views
Last Modified: 2013-12-12
i have a javascript table that is populated from a tadabase table called "games" with the following query:

$query1="select * from games";
...and then some inserting into the js table

one of the table columns i have is the game_date.
i want to get it so that games that have already happened are no longer in my js table
i want a query something like:
$query1="select * from games WHERE current_date > game_date";

does my game_date have to be of time type?
does it need to be in a specific format?
is there a php function that gets the current date?
how should i go about comparing these 2 dates - i'm a total n00b
Comment
Watch Question
Commented:
This problem has been solved!
Unlock 3 Answers and 6 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE