Now that I have DATE_FORMAT working, I'd like to chop up the date into parts...how is this done?
Hello All,
First off, many thanks to my friends Bregent and iPHP for helping me get my last problem sorted out, and fast.
Now, I have this query:
$sql = "SELECT page_ym, cal_dates, available, location, event,
DATE_FORMAT(cal_dates, '%W %D') AS cdate
FROM cal_data
WHERE cal_data.page_ym = '$dateRef%'";
$result = $conn->query($sql) or die(mysqli_error());
$calSpec = $result->fetch_assoc();
and it works perfectly.
What I'd like to do is separate the weekday and date in the $calSpec['cdate'] string into two different items.
I have fiddled with the explode function but I don't think I'm doing it right. I'm assuming I'd explode the string, $calSpec['cdate'] and store its components in an array within the do while loop I have set up to populate the page with dates.
Is this the best approach? If so, can anyone steer me in the right direction with regards to proper explode syntax?
You are all amazing people, thank you in advance for your help!
Sincerely,
wordman
