Why Codeigniter doesn't make presentation data the same order Postgres does?

Hi Experts!

I'm facing a problem in making Codeigniter ressembles a Postgres query

The Codeigniter code (with tentatives)

	public function getPublicacoes($qtd = 0,$inicio = 0) {
    		
             $this->db->where('fk_idsetor','5');
            
             //EF 2015:
            $this->db->order_by("imagem_issuu DESC NULLS LAST");
            
            // Apresenta inicialmente todos com o livro eletronico ISSUU
           //$this->db->order_by('imagem_issuu');
            
    		if($qtd > 0){
    			$this->db->limit($qtd,$inicio);
    		}
    		return $this->db->get('tb_publicacoes');
    	}

Open in new window


Seeing the phppgadmin it looks fine

select * from tb_publicacoes ORDER BY imagem_issuu DESC NULLS LAST

 img_001

But the site doesn't presents it in the desired order the NULL line is presented before in some cases:

img_002
Do you know what's going wrong or must be configured (in Codeigniter)  ?

Thanks in advance.
Eduardo FuerteDeveloper and AnalystAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gheistCommented:
can you log DB queries that codeigniter is generating?
Does it use same DB encofing as pgadmin3?
0
mrcoffee365Commented:
gheist is right .  

You can control how db queries work when you make them directly.  When you use a framework, you're stuck.  Frameworks can be good to get started, but most application programming requires greater control over the code, as you're finding.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Eduardo FuerteDeveloper and AnalystAuthor Commented:
Sorry...

It was a matter of my own confusion.

I had changed one method and the method fired was another!
Now everything ok!

Thanks for the assistance!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.