Where my problem lies is i want to pass a variable $date (which comes out in this format 2002-12-10) which comes from mysql database to the mktime function which will then give me a unix timestamp.
Hope that makes sense
Moderator: General Moderators
Code: Select all
<?php
int mktime ( int hour, int minute, int second, int month, int day, int year)
?>Code: Select all
SELECT
DATE_FORMAT($date, '%m') AS month,
DATE_FORMAT($date, '%d') AS day,
DATE_FORMAT($date, '%Y') AS year
FROM database;Code: Select all
<?php
$timestamp = mktime (0, 0, 0, $month, $day, $year);
?>