I've got a database with multiple rows and columns, which are grabbed with PDO.
$sql = "SELECT timestamp FROM table";
$stmt = $dbh->prepare($sql);
$results = $stmt->execute;
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
One of the database columns is timestamp which is a 10 digit unix timestamp. I'd like to convert this server side to a readable format before sending it to the browser.
This is how I'd like it to be formatted, but I know it needs to be done on every row and this is where it trips me up. Possibly a foreach loop?
$results['timestamp'] = date('H:i\, l jS \of F Y', $results['timestamp']);