I'd like to store both my date and time in the same table (a datetime table)
When I query the database, I'd like to break apart these to get month, day, year, hour, etc in separate variables
Here's what I have done:
$select = mysql_query("SELECT *,DATE_FORMAT(date, '%M') AS month,DATE_FORMAT(date, '%e') AS day,DATE_FORMAT(date, '%Y') AS year FROM mytable WHERE id = '$_GET[id]' LIMIT 1") or die(showerror());
Is there any easier way to break everything apart other than having like 6 different date_format things? Maybe somehow just select the date once, then format it in PHP?