problem with Mktime in SQL sentence

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
yuri1992
Forum Newbie
Posts: 10
Joined: Sun Aug 03, 2008 8:49 am

problem with Mktime in SQL sentence

Post 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());
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: problem with Mktime in SQL sentence

Post 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());
 
Post Reply