Welcome Guest, Not a member yet? Register   Sign In
codeigniter active record bug?
#3

[eluser]Unknown[/eluser]
[quote author="JHackamack" date="1263423314"]Right after your query runs have you echoed out:

$this->db->last_query();

are the results the same, or different for the second date format.

Also another thing to try that might be foiling it is aliasing your columsn

DATE_FORMAT(start_date, '%d %b, %Y') as start_date

I believe MySQL assigns a date_format to both columns, so one will overwrite the other.[/quote]

If you notice carefully the code sample that I gave you, you will find the difference is only a matter of a comma

DATE_FORMAT(end_date, '%d %b %Y')

and

DATE_FORMAT(end_date, '%d %b, %Y') --> this doesn't work


yes I echoed the query (the one without a comma) and tried it on phpmyadmin to see if it is correct

the query runs OK, I got what I wanted
and when I added a comma to the date format of the second date column it also runs OK
it gives me two column of date with '%d %b, %Y'

but when I give this format to active records it failed

It only accept one '%d %b, %Y' (with comma) and one '%d %b %Y' (without comma)

my summary is
active records only accepts
DATE_FORMAT(end_date, '%d %b %Y') and DATE_FORMAT(end_date, '%d %b, %Y') in one query

it cannot accepts
DATE_FORMAT(end_date, '%d %b, %Y') and DATE_FORMAT(end_date, '%d %b, %Y')

can someone try this ? I think this is very not right to have


Messages In This Thread
codeigniter active record bug? - by El Forum - 01-13-2010, 09:58 AM
codeigniter active record bug? - by El Forum - 01-13-2010, 10:55 AM
codeigniter active record bug? - by El Forum - 01-13-2010, 08:30 PM
codeigniter active record bug? - by El Forum - 01-13-2010, 08:33 PM
codeigniter active record bug? - by El Forum - 01-14-2010, 09:56 AM
codeigniter active record bug? - by El Forum - 01-14-2010, 10:20 AM
codeigniter active record bug? - by El Forum - 01-14-2010, 10:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB