I hate to do this, but I've searched this forum for the better part of 2 hours, and looked through the PHP guide dealing with dates and time functions, but for the life of me I cannot figure out how to do what is probably a VERY simple function. I'm really hoping someone can help me!
What I've got is a date function stored in a field called cal_date in a table. The format is standard Date format: yyyy-mm-dd
Anyways, I have it set up all nifty to enter the data in, BUT i need to be able to edit this date using drop downs (similar to how it is entered).
What I really want to do is very simple, break the date (yyyy-mm-dd) into 3 variables:
$cal_year
$cal_month
$cal_day
I can handle it from there, but for the life of me I don't know how to get from my database query, broken down into those 3 variables.
$sql ="SELECT cal_id, cal_date, date_format(cal_date,'%m-%d-%Y') AS cal_date_display, cal_time, cal_type, cal_name, cal_location, cal_coordinator, cal_telephone, cal_instructor, cal_registration FROM $table_name WHERE cal_id = '$_GET[id]'";
$result = @mysql_query($sql,$connection) or die(mysql_error());
Any help will be much appreciated. This has been a HUGE project, and I'll be darned if this one little thing isn't the ONLY problem I haven't been able to solve on my own....rather annoying!