Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Db:select where negative number
  • I am not sure why by when i search for a negative number DB::select()->from('table')->where('number','=',-1) the result is zero though I am sure the row exists. any ideas? thanks
  • In your example you don't execute() it at the end, did you leave it out on purpose or did you forget it in your code? If you did we should test whether the query is correct, this can be done by echo'ing the query before you execute it. Thus:
    $query = DB::select()->from('table')->where('number','=',-1);
    echo $query;
    exit();
    
  • hi Jelmer, you are right.i ommited the "execute()" but I have it in my code.the query works fine if the number is positive.its just when the minus sign is included,that's when it doesn't work. Well to be more exact the query count is zero. I thought it might be due to how fuelphp escapes values.by the way this is on Rc2.1.
    thanks for your help

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion