[eluser]nagolpj[/eluser]
My web site is completly coded with CI and I need help formatting the output of dates stored in MySQL. Currently, the date is stored in the DB as YYYY-MM-DD but in order for the exported file to correctly import into my software, I need to date to be formatted MM/DD/YYYY. I think the data posts in the correct format but then changes since the column is a DATE column. I don't know exactly though.
Anyway, I assume the fix lies within this piece of code:
Code:
foreach ($result as $row)
{
if ($row['Event']['type'] != 'Relay')
{
$output .= "E;";
$output .= $row['Athlete']['lname'].";";
$output .= $row['Athlete']['fname'].";";
$output .= ";";
$output .= $row['Athlete']['gender'].";";
$output .= $row['Athlete']['birthday'].";";
$output .= $row['School']['abbr'].";";
$output .= $row['School']['name'].";";
$output .= ";";
$output .= $row['Athlete']['grade'].";";
$output .= $row['Event']['code'].";";
$output .= $row['Meet_Athlete']['mark'].";";
$output .= (($row['Event']['type'] == 'Field') ? "E": "M").
";;\r\n";
}
}
Specifically, this line:
Code:
$output .= $row['Athlete']['birthday'].";";
And in case you are wondering, the data get's exported to a semicolon delimited file so that's why you see so many semicolons.
Any idea how I would alter this code to get the format that I need?