I wanna select a timestamp column that contain a date.
I want the result in seconds, I've tryed this but it's not working.
$req = $database->query('SELECT energy, maxEnergy, DATE_FORMAT(last_attack, "%s") FROM users WHERE id = '.$userID.'');
last_attack column contain : 2018-09-05 09:26:38
And the result give me : ["DATE_FORMAT(last_attack, "%s")"]=> string(2) "38"
I don't want the seconds in my date, I want all the date converted in seconds...
What am I doing wrong ? Thanks.