'? BETWEEN Sequence.sequence_ini AND Sequence.sequence_end' => array (1000)
On Oct 24, 5:43 am, Luciano Hoffmann <[email protected]> wrote: > how can I compare if a value is between two values in the database ? > > Ex: > In the database I have a table sequences with the fields sequence_ini > and sequence_end > > I wanna know if the value 1000 is between the sequence_ini and the > sequence_end > > In SQL: > SELECT count(id) FROM sequences WHERE 1000 BETWEEN sequence_ini AND > sequence_end; > > In Cake: > $Sequence->find('count', array('conditions' => array( '1000 BETWEEN ? > AND ? ' => array( 'Sequence.sequence_ini', 'Sequence.sequence_end' ); > > It doesn´t work because cakephp thinks 1000 is a field and warn an > error; --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
