Page 1 of 1

problem with Mktime in SQL sentence

Posted: Wed Sep 30, 2009 9:28 am
by yuri1992
hello all ,
i need to mix between SQL AND PHP , i need to check if the dates in the table the are between two dates that i have,
becuse this i need to use mktime to know this time in minutes

$query223 = mysql_query("

SELECT day As daylong,hour As hourlong,year As yearlong,mon As monlong,min As minlong,
(mktime(hourlong,minlong,0,monlong,daylong,yearlong)) As timed
FROM
Kings
WHERE Status='Win' && timed>123123123
") or die(mysql_error());

Re: problem with Mktime in SQL sentence

Posted: Wed Sep 30, 2009 1:05 pm
by Jade
Please use the Code tag when posting code!! Make it easier to read.

You're looking for something like this:

Code: Select all

 
$query223 = mysql_query("
SELECT day As daylong,hour As hourlong,year As yearlong,mon As monlong,min As minlong,
" . mktime($hourlong,$minlong,0,$monlong,$daylong,$yearlong) . " As timed
FROM
Kings
WHERE Status='Win' && timed>123123123
") or die(mysql_error());