I have a MySQL database with a date column.
I create a variable of the value in PHP like this:
$query = mysql_query ("SELECT customer_date FROM customers WHERE customer_id = {$_SESSION['session_id']}");
while ($result = mysql_fetch_object($query)) {
$date = $result->customer_date;
}
I need to convert the $datefrom YYYY-MM-DD to three variables
$yearvalue(for example 2012)$monthname(for example August)$dayvalue(for example 10)
And I need to be able to echo out anywhere in my code… How would I do this in a fancy way? I’m pretty new to coding…
Here:
It’ll only work/store the value of these values for the last row outputted from the
$result.