Yes this is what I thought, building extra functionality that’s not really needed, not just yet anyhow 
No worries if you’re doing it differently anyway.
Cool, still doing the same thing and some good code and ideas here if I decide to extend and build up on this thanks m3g4p0p
I don’t see an immediate error in the code… is it not working?
On the contrary… it works very well 
Truth be said, it was too easy ha - this is why I thought something can’t be right. I think because I spent a lot of time thinking things wouldn’t work, and all the time we spent on the JSON etc.
That’s nice to here!
Thanks again, couple of questions below:
I’m now trying to return only the events that have a date/timestamp of today onwards using FROM_UNIXTIME(DTSTART) AS FT
… though something not right?
$queryEvents = "
SELECT ID
, DTEND
, DTSTAMP
, LOCATION
, DTSTART
, SUMMARY
, FROM_UNIXTIME(DTSTART) AS FT
FROM events_test
WHERE FT >= NOW()
ORDER BY DTSTART ASC";
And remember that DTSTART is a VARCHAR timestamp inside the DB. Every works if I remove FROM_UNIXTIME(DTSTART) AS FT
and WHERE FT >= NOW()
But if I leave it in:
Call to a member function fetch_assoc() on a non-object in…
If it helps…
Further down from above I have the below which converts some dates:
$resultEvents = $mysqli->query($queryEvents);
$eventsArray = array();
while ($row = $resultEvents->fetch_assoc()) {
$row['endTime'] = date('g:ia', strtotime($row['DTEND']));
$row['fullDate'] = date('l jS F Y', strtotime($row['DTSTART']));
$row['startTime'] = date('g:ia', strtotime($row['DTSTART']));
$eventsArray[] = $row;
}
On the page I’m using things like:
foreach($eventsArray as $value){
echo {$value['LOCATION']} {$value['endTime']}
And if I remember correctly, somebody once said it would be quicker if I return events from >= NOW()
using the PHP code, instead of inside the SQL? Not sure if there is much difference in the speed.
Barry