This is my PHP/MySQL query, as mentioned at Displaying links in PHP/MySQL?:
I'll admit, I've forgotten how to use the strtotime() function effectively, as I want to show my show times in this format:
06:00
10:00
(without the :00 at the end, e.g. 10:00:00)
The code displays this error now:
Parse error: syntax error, unexpected T_ECHO in C:\www\vhosts\localradio\schedsun.php on line 11
I've fixed the errors in the previous question, how could I adapt this if I wanted to show the time as:
6:00am
06:00
6am
(just for testing sake, within the parameters of the code on Pastebin).
I'm basically asking simply as I'm doing my own refresher course in other parts of PHP, having spent so long learning arrays etc.
Finally, do I need as a variable or not - or is $result_ar not needed?
Thank you for your help on the last question!
You can do it directly in MySQL, which saves you the overhead of strtotime()'s parseing overhead, and guaranteed to produce the right results, as strtotime can guess wrong occasionally.
SELECT DATE_FORMAT(yourdatefield, '%h:%i') ...