Hey there. I'm trying to retrieve a date from an SQL table. The original formate of the date is as follows:

0000-00-00 00:00:00

I want to try and change the format into: Month Date, Year e.g. May 17, 2014

$page_title = 'View the current users';


      $query = ( "SELECT last_name, first_name, registration_date \n"
        . "FROM `users` \n"
        . "ORDER BY registration_date ASC");        

    $statement = $db->query($query);
    while($row = $statement->fetch(PDO::FETCH_ASSOC)){
        echo $row['last_name'] . " " . $row['first_name'] ." " . 
        echo "<br>"; 
}catch(PDOException $e){
        $message = '<p>Something went wrong!</p><p>' . $e->getMessage() . '</p>';

Will I have to put the 'registration_date' into an array and chnage the format from there?

Many thanks

Re: Changing date value from SQL table 80 80

Tried deleting the post, but I solved it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.