PHP Classes

start_group bug

Recommend this page to a friend!

      CRDB  >  CRDB package blog  >  Request for feed back  >  All threads  >  start_group bug  >  (Un) Subscribe thread alerts  
Subject:start_group bug
Summary:start_group bug
Messages:3
Author:geert van bommel
Date:2009-08-10 12:58:22
Update:2009-08-11 07:04:26
 

  1. start_group bug   Reply   Report abuse  
Picture of geert van bommel geert van bommel - 2009-08-10 12:58:23
I think I found a bug when using the start/end_group. An 'AND' is missing and there is a bracket too much at the end of the where clause.

example: $db->field1('value1')->start_group()->field2('firstvalue')->or()->field2('secondvalue)->end_group();

I know in this case it can be solved like so : $db->field1('value1')->field2(array('firstvalue','secondvalue'));

But the problem remains when the or is between different fields. So the example of the documentation does not work:

//for name='user_one' and (key>10 or no>100)
$rowset=$db->user->name('user_one')->start_group()->key('>',10)->or()->no('>',100)->end_group();

  2. Re: start_group bug   Reply   Report abuse  
Picture of Sandeep.C.R Sandeep.C.R - 2009-08-11 04:07:00 - In reply to message 1 from geert van bommel
hi,

I cant thank you enough.I have fixed the bug and have uploaded.I hope the bug hasnt caused you too much trouble.I hope you are using the debug feature which echos the generated query so you know what is going on when something goes wrong.

Thanks again.
Sandeep

  3. Re: start_group bug   Reply   Report abuse  
Picture of geert van bommel geert van bommel - 2009-08-11 07:04:26 - In reply to message 2 from Sandeep.C.R
Hi,
yes, thanks to the debug feature I figured this out. No trouble at all. I am converting existing queries to use your class. Thank you for fixing it so fast!

Kind Regards,Geert