I am inserting values from the FB API into my DB. One of those values is a timestamp
for each one of the events creation time.
The way it is set up right now its grabbing all of the users tagged_places
. I am trying to compare the time the tagged_place
was created to the Current Time and if its not within the past 24 hours I want it to be ignored.
I know I need to convert the timestamp in the DB for a way for php to read it. I find this
But I am not understanding how to implement it.
Here is my insert query to the DB,
$stmt = $con->prepare('
INSERT INTO taggedPlaces
(id, created_time, place_id, latitude, longitude, name)
VALUES
(?, ?, ?, ?, ?, ?)
');
foreach($graphObject['tagged_places']->data as $data) {
$stmt->execute(array(
$data->id,
$data->created_time,
$data->place->id,
$data->place->location->latitude,
$data->place->location->longitude,
$data->place->name
));
}
How can I change this to only insert the values in data that have been created in the past 24 hours?