How I can diminish the size of this search? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: How I can diminish the size of this search? (/showthread.php?tid=3361) |
How I can diminish the size of this search? - El Forum - 09-26-2007 [eluser]andregufc[/eluser] Quote://CALCULATE TOTAL ROWS Thx! How I can diminish the size of this search? - El Forum - 09-26-2007 [eluser]ELRafael[/eluser] how you get this vars? ($Imo_Cart_Bloco, etc..) maybe you can do a dynamic where, but i need to know how you get this vars... PS: (vc é brasileiro?) How I can diminish the size of this search? - El Forum - 09-26-2007 [eluser]andregufc[/eluser] opa so sim =) finalmente axei alguem aki q fla pt.. entaum, eu pego ela através do $_POST['campo']... mas oq eu realmente queria saber eh se eh realmente necessário repetir a pesquisa, uma vez para contar o numero de registros encontrados e outra para pegar os dados. eu dei uma pesquisada aki no forum e axei algumas coisas, mas nada resolveu.. vlw! How I can diminish the size of this search? - El Forum - 09-27-2007 [eluser]andregufc[/eluser] obs.: essas variaveis q eu mostrei, são apenas uma parte da consulta. A tabela possui mais de 500 mil registros e a consulta possui umas 30 cláusulas where e like além das que eu mostrei, por isso a consulta está um pouco lenta... tradução do google =P obs.: these variaveis q I showed, I am only one part of the consultation. The table possesss more than 500 a thousand registers and the consultation possesss 30 clauses (where and like) beyond that I showed, therefore the consultation is slow… How I can diminish the size of this search? - El Forum - 09-27-2007 [eluser]ELRafael[/eluser] Let'me understand one thing... You'll make one query with 30 where/like conditions? For sure your query'll be slow!!! Try to think if your logic is correct! if you have this vars by post, you can do this (try a foreach) Code: $this->db->where($key_from_post, $value_from_post); To count the regs, use Code: $this->db->count_all('table_name'); ------------------- A galera aqui provavelmente vai reclamar se tiver post em portugues, vamo bater uma aposta ? tá ligado como é gringo né :coolsmirk: Já a sua tradução by google ficou hilária velho... mas enfim! Tipo, se vc tiver 30 consultas por where/like, vc vai fritar mesmo a aplicação cara! tenta rever essa regra de negócios ae... Mas acho que dá pra por a procura dinamica, igual tá os blocos de código acima. Me manda um PM, ai a gente conversa fora do forum mesmo!!! Abraços |