Reputation: 1
Varchar
date field is stored like this: 2013-06-17 00:00
$date = date("Y-m-d H:i");
$query = "SELECT Date,Away,vTotal,vML,Home,hLine,hTotal,hML FROM `LINES` ORDER by Date ASC WHERE Date > '$date' ";
Upvotes: 0
Views: 2622
Reputation: 15464
First. Your query is wrong.
$query = "SELECT Date,Away,vTotal,vML,Home,hLine,hTotal,hML FROM `LINES` WHERE Date > '$date' ORDER by Date ASC";
Also you can compare string values in MySQL by more or less operators.
P.S. Think about conversion to date/time type.
Upvotes: 2
Reputation: 19748
http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html#function_str-to-date
Believe you'll want to use the function above and be doing a Date comparison. Agree with the comment that dates should be stored as DATE DATETIME or TIMESTAMP.
Upvotes: 0