![]() |
Problems with a query using Active Record - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Problems with a query using Active Record (/showthread.php?tid=17709) |
Problems with a query using Active Record - El Forum - 04-13-2009 [eluser]Unknown[/eluser] hello, I'm having a problem with a query using Active Record, when many use conditions. The Model code is: Code: function listar_softwares($args = array()) Passing the parameters correctly, he returns the following query: Code: SELECT `s`.*, `di`.`nome` AS distribuicao, `s`.`data_cadastro` AS data The problem is that between the results returned, the information is not completely identical, for example, some results have the 's'. 'Id_distribuicao' different from 3. I believe, to use "( )" - brackets - and solve the problem but how to do this using the Active Record to CodeIgniter? Sorry if there are grammatical errors, I used google translate. Thanks! Problems with a query using Active Record - El Forum - 04-13-2009 [eluser]Eric Barnes[/eluser] Not sure if I understand but wouldn't or_like or or_where work for this? Problems with a query using Active Record - El Forum - 04-13-2009 [eluser]Unknown[/eluser] Unfortunately not, because the case would be the same AND, the OR was only under conditions where there is LIKE. This function is to be used in a search, where there are 3 options to filter, one for the category(categoria), one for distribution(distribuição) and one for the platform(plataforma). |