Re: wtf find id=1

2009-08-14 Thread delocalizer

you're right, it is certainly a bug... but not in cake... for starters
it should be 'fields'=array('position','position_id')...

On Aug 14, 10:22 am, AgBorkowski andrzejborkow...@gmail.com wrote:
 $this-Position-find('all',array('conditions' = 'position_id = '.
 $id,'fields'='position,position_id') this working fine...
 9       SELECT `Position`.`position`, `Position`.`position_id` FROM
 `mgt_positions` AS `Position` WHERE position_id = 3

 fucking stupid bug

 On 14 Sie, 02:18, andrzejborkow...@gmail.com

 andrzejborkow...@gmail.com wrote:
  fk find(){
  echo $id; //3
                          
  debug($this-Position-find('all',array('conditions' = array
  ('position_id'=$id),'fields'='position,position_id')));

  }

  at page
  miopromo\controllers\signups_controller.php (line 70)

  Array
  (
      [0] = Array
          (
              [Position] = Array
                  (
                      [position] = Wlasciciel/Wspolwlasciciel
                      [position_id] = 1
                  )

          )

  9       SELECT `Position`.`position`, `Position`.`position_id` FROM
  `mgt_positions` AS `Position` WHERE `position_id` = 1

  WTF ?
--~--~-~--~~~---~--~~
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: wtf find id=1

2009-08-14 Thread delocalizer

As AD7six says, it's very hard to say anything useful given that you
have just typed in some stuff and not actually pasted any relevant
code, but from what you have above, you do not seem to be following
any helpful naming convention - you've called Position-find and from
the 'SQL' you posted clearly cake thinks that that model is associated
with a table called mgt_positions - which is not convention but fine,
but then what is the field called 'position_id'!? That is convention
for a foreign key to a table called positions! Just very confusing.

On Aug 14, 10:22 am, AgBorkowski andrzejborkow...@gmail.com wrote:
 $this-Position-find('all',array('conditions' = 'position_id = '.
 $id,'fields'='position,position_id') this working fine...
 9       SELECT `Position`.`position`, `Position`.`position_id` FROM
 `mgt_positions` AS `Position` WHERE position_id = 3

 fucking stupid bug

 On 14 Sie, 02:18, andrzejborkow...@gmail.com

 andrzejborkow...@gmail.com wrote:
  fk find(){
  echo $id; //3
                          
  debug($this-Position-find('all',array('conditions' = array
  ('position_id'=$id),'fields'='position,position_id')));

  }

  at page
  miopromo\controllers\signups_controller.php (line 70)

  Array
  (
      [0] = Array
          (
              [Position] = Array
                  (
                      [position] = Wlasciciel/Wspolwlasciciel
                      [position_id] = 1
                  )

          )

  9       SELECT `Position`.`position`, `Position`.`position_id` FROM
  `mgt_positions` AS `Position` WHERE `position_id` = 1

  WTF ?
--~--~-~--~~~---~--~~
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: wtf find id=1

2009-08-13 Thread AgBorkowski

$this-Position-find('all',array('conditions' = 'position_id = '.
$id,'fields'='position,position_id') this working fine...
9   SELECT `Position`.`position`, `Position`.`position_id` FROM
`mgt_positions` AS `Position` WHERE position_id = 3

fucking stupid bug

On 14 Sie, 02:18, andrzejborkow...@gmail.com
andrzejborkow...@gmail.com wrote:
 fk find(){
 echo $id; //3
                         debug($this-Position-find('all',array('conditions' 
 = array
 ('position_id'=$id),'fields'='position,position_id')));

 }

 at page
 miopromo\controllers\signups_controller.php (line 70)

 Array
 (
     [0] = Array
         (
             [Position] = Array
                 (
                     [position] = Wlasciciel/Wspolwlasciciel
                     [position_id] = 1
                 )

         )

 9       SELECT `Position`.`position`, `Position`.`position_id` FROM
 `mgt_positions` AS `Position` WHERE `position_id` = 1

 WTF ?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---