![]() |
Problem with Where clause - 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: Problem with Where clause (/showthread.php?tid=33432) |
Problem with Where clause - El Forum - 08-25-2010 [eluser]Byrro[/eluser] Hello, My Model has this two methods: Code: /* And my Controller: Code: function header($hashed_pim = NULL) { The problem is: look at the first method in the model class; there´s a line that is commented out with the following code: Code: // $DBempresa->where('hashed_pim', $hashed_pim); When it´s commented out, the code works fine. But when I use the Where clause it just doesn´t work!.. It keeps giving this: Quote:A PHP Error was encountered If I put the exact string that is passed from the variable $hashed_pim, like this: Code: $DBempresa->where('hashed_pim', 'hash_string_here'); Works. But not with the variable. I´ve tested it and the variable is passing the right string. What am I doing wrong? Would you have any tips? Problem with Where clause - El Forum - 08-25-2010 [eluser]danmontgomery[/eluser] The first thing you did wrong was abandon an identical thread you made this afternoon: http://ellislab.com/forums/viewthread/165533/ Problem with Where clause - El Forum - 08-26-2010 [eluser]WanWizard[/eluser] Where is your call to controller->header()? I'd like to see what parameter you pass to it. Or is this a URI parameter? Imho there is no way that "$DBempresa->where('hashed_pim', $hashed_pim);" gets translated by AR to "WHERE hashed_pim = '$hashed_pim'". |