[eluser]JHackamack[/eluser]
[quote author="noctrum" date="1263506176"]Tried this locally and both queries work fine for me, I think your problem is something else.
Code:
$this->load->database();
$res = $this->db->select("some_data, DATE_FORMAT(start_date, '%d %b, %Y'), DATE_FORMAT(end_date, '%d %b, %Y')", false)->get('test_table')->result();
echo "<xmp>";
foreach($res as $row){
echo print_r($row, true);
}
echo "</xmp>";
Quote:stdClass Object
(
[some_data] => Test data A
[DATE_FORMAT(start_date, '%d %b %Y')] => 14 Jan, 2010
[DATE_FORMAT(end_date, '%d %b %Y')] => 14 Jan, 2010
)
stdClass Object
(
[some_data] => Test data B
[DATE_FORMAT(start_date, '%d %b %Y')] => 14 Jan, 2010
[DATE_FORMAT(end_date, '%d %b %Y')] => 14 Jan, 2010
)
stdClass Object
(
[some_data] => Test data C
[DATE_FORMAT(start_date, '%d %b %Y')] => 14 Jan, 2010
[DATE_FORMAT(end_date, '%d %b %Y')] => 14 Jan, 2010
)
stdClass Object
(
[some_data] => Test data D
[DATE_FORMAT(start_date, '%d %b %Y')] => 14 Jan, 2010
[DATE_FORMAT(end_date, '%d %b %Y')] => 14 Jan, 2010
)
[/quote]
The problem that i see is all your dates are formatted the same way in the result, even though you specified a different format in date_format.
AKA:
%d %b %Y returns 14 Jan, 2010 in your result (where did the comma come in)