Re: Pass true or false as condition

2010-09-08 Thread Shaz
Also if I remember correctly cakephp doesn't read bolean from a
database?

http://nuts-and-bolts-of-cakephp.com/2008/10/06/cakephp-mysql-tinyint1-confusion/



On Sep 7, 10:11 pm, Miles J mileswjohn...@gmail.com wrote:
 Couldn't you just pass 1 and 0?

 Also your argument is backwards. True should be 1 and false should be
 0.

 isDeleted = true = 1
 hasRelations = true = 1

 On Sep 7, 2:06 pm, Dave Maharaj m...@davemaharaj.com wrote:

  I am passing true or false as a condition in a find() but stumped how to
  pull db records based on the true or false.

  Basically in the db table I have a bool field

  If TRUE is passed as a condition I need to get only records where the bool
  value is ZERO, if FALSE get all ZERO and 1 records.

  Thoughts?

  Thanks

  Dave

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Pass true or false as condition

2010-09-08 Thread j.blotus
instead of using boolean why not just use tinyint(1)

On Sep 8, 6:32 am, Shaz shazam...@gmail.com wrote:
 Also if I remember correctly cakephp doesn't read bolean from a
 database?

 http://nuts-and-bolts-of-cakephp.com/2008/10/06/cakephp-mysql-tinyint...

 On Sep 7, 10:11 pm, Miles J mileswjohn...@gmail.com wrote:



  Couldn't you just pass 1 and 0?

  Also your argument is backwards. True should be 1 and false should be
  0.

  isDeleted = true = 1
  hasRelations = true = 1

  On Sep 7, 2:06 pm, Dave Maharaj m...@davemaharaj.com wrote:

   I am passing true or false as a condition in a find() but stumped how to
   pull db records based on the true or false.

   Basically in the db table I have a bool field

   If TRUE is passed as a condition I need to get only records where the bool
   value is ZERO, if FALSE get all ZERO and 1 records.

   Thoughts?

   Thanks

   Dave

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


RE: Pass true or false as condition

2010-09-08 Thread Dave Maharaj
My setting was if you want something removed so if selected that's users
setting was true so then when time to get records if user.display = true
its saying do not get records where that is true

If its User.setting = FALSE then I have to get 0 and 1

It sounds backwards but remove setting = true yes I want to remove or no I
want to keep make sense then when you get records then get 0 and 1 if false
or only 1 if true...

But anyways I managed to get it sorted out.

Thanks guys



Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Pass true or false as condition

2010-09-07 Thread Dave Maharaj
I am passing true or false as a condition in a find() but stumped how to
pull db records based on the true or false.

 

Basically in the db table I have a bool field

 

If TRUE is passed as a condition I need to get only records where the bool
value is ZERO, if FALSE get all ZERO and 1 records.

 

Thoughts?

 

Thanks

 

Dave

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Pass true or false as condition

2010-09-07 Thread Miles J
Couldn't you just pass 1 and 0?

Also your argument is backwards. True should be 1 and false should be
0.

isDeleted = true = 1
hasRelations = true = 1

On Sep 7, 2:06 pm, Dave Maharaj m...@davemaharaj.com wrote:
 I am passing true or false as a condition in a find() but stumped how to
 pull db records based on the true or false.

 Basically in the db table I have a bool field

 If TRUE is passed as a condition I need to get only records where the bool
 value is ZERO, if FALSE get all ZERO and 1 records.

 Thoughts?

 Thanks

 Dave

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en