Renato

CodeIgniter User Guide Version 1.6.1


> $this->db->order_by();
> 
> Lets you set an ORDER BY clause. The first parameter contains the name 
> of the column you would like to order by. The second parameter lets you 
> set the direction of the result. *Options are asc or desc, or random.*
> $this->db->order_by("title", "desc");
> 
> // Produces: ORDER BY title DESC
> 
> You can also pass your own string in the first parameter:
> $this->db->order_by('title desc, name asc');
> 
> // Produces: ORDER BY title DESC, name ASC
> 
> Or multiple function calls can be made if you need multiple fields.
> 
> $this->db->order_by("title", "desc");
> $this->db->order_by("name", "asc");
> 
> // Produces: ORDER BY title DESC, name ASC
> 

Vê se ajuda... ;) E olha que eu ando enxergando mal... heheheheh

Muita sorte para nós!

Marco Telles




Renato Costa Barbosa escreveu:
> Opa
> Yeah, li sim,
> eu estyou usando a 1.6.1 e procurei na sessão Database Library, me 
> apeguei mais no tópico active record, mas na pesquisa inteira, eu num 
> achei nada fala fale sobre o rand
> Normalmente eu uso o sql dessa forma SELECT * FROM table ORDER BY 
> RAND(), apenas para randomizar sem nenhum tratamento
>
>


_______________________________________________
Lista mailing list
[email protected]
http://codeigniter.com.br/mailman/listinfo/lista_codeigniter.com.br

Responder a