Re: Cakephp generates Wrong query in PHP4?

2007-07-08 Thread M

Hello Samuel, I did it and now it works in php 4 and php 5. I posted
this problem because previously,
after replacing findByUserId with findByUser_Id it was giving an error
like it was not finding user__id in table.
However I am not capable of reproducing the problem.

If it happens, I will post the error, (at most I will use
find( $criteria = 'user_id' = $user_id ) )

Thanks

- Michele

On Jul 7, 11:50 pm, Samuel DeVore [EMAIL PROTECTED] wrote:
 I am fairly sure that in php 4 you have to do FindByUser_Id I know this used
 to be the case due to limitations in php 4  
 seehttps://trac.cakephp.org/ticket/1567for a ticket on the manual for this.
 I hope that one of the Cake Devs can confirm or deny this

 Sam D

 On 7/7/07, M [EMAIL PROTECTED] wrote:





  CakePHP version: : 1.1.15.5144.

  Hello, the Bankaccount model belongs to User model.

  Now, in BankaccountsController::view method I have this statement:

  $data = $this-Bankaccount-findByUserId( $user_id );

  In PHP 5  it works fine.

  In PHP  4.4.7 it gives this error:

  Query: SELECT `Bankaccount`.`id`, `Bankaccount`.`user_id`,
  `Bankaccount`.`credits`, `Bankaccount`.`created`,
  `Bankaccount`.`modified`, `User`.`id`, `User`.`username`,
  `User`.`password`, `User`.`name`, `User`.`email`, `User`.`telno`,
  `User`.`race`, `User`.`sex`, `User`.`level`, `User`.`hp`,
  `User`.`hpmax`, `User`.`str`, `User`.`strmax`, `User`.`dex`,
  `User`.`dexmax`, `User`.`int`, `User`.`intmax`, `User`.`cha`,
  `User`.`chamax`, `User`.`energy`, `User`.`credits`,
  `User`.`last_visit`, `User`.`group_id`, `User`.`active`,
  `User`.`token`, `User`.`created`, `User`.`modified` FROM
  `bankaccounts` AS `Bankaccount` LEFT JOIN `users` AS `User` ON
  (`Bankaccount`.`user_id` = `User`.`id`) WHERE `Bankaccount`.`userid` =
  5 LIMIT 1
  Warning: SQL Error: 1054: Unknown column 'Bankaccount.userid' in
  'where clause' in ...cake/libs/model/datasources/dbo_source.php on
  line 463

  Fatal error: Call to undefined method: bankaccount-onerror() in .../
  cake/libs/model/datasources/dbo_source.php on line 596

  have I done something wrong or there is an incompatibility?

  Thanks

  -- M

 --
 (the old fart) the advice is free, the lack of crankiness will cost you

 - its a fine line between a real question and an idiot

 http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Cakephp generates Wrong query in PHP4?

2007-07-08 Thread M

Hello Samuel, I did it and now it works in php 4 and php 5. I posted
this problem because previously,
after replacing findByUserId with findByUser_Id it was giving an error
like it was not finding user__id in table.
However I am not capable of reproducing the problem.

If it happens, I will post the error, (at most I will use
find( $criteria = 'user_id' = $user_id ) )

Thanks

- Michele

On Jul 7, 11:50 pm, Samuel DeVore [EMAIL PROTECTED] wrote:
 I am fairly sure that in php 4 you have to do FindByUser_Id I know this used
 to be the case due to limitations in php 4  
 seehttps://trac.cakephp.org/ticket/1567for a ticket on the manual for this.
 I hope that one of the Cake Devs can confirm or deny this

 Sam D

 On 7/7/07, M [EMAIL PROTECTED] wrote:





  CakePHP version: : 1.1.15.5144.

  Hello, the Bankaccount model belongs to User model.

  Now, in BankaccountsController::view method I have this statement:

  $data = $this-Bankaccount-findByUserId( $user_id );

  In PHP 5  it works fine.

  In PHP  4.4.7 it gives this error:

  Query: SELECT `Bankaccount`.`id`, `Bankaccount`.`user_id`,
  `Bankaccount`.`credits`, `Bankaccount`.`created`,
  `Bankaccount`.`modified`, `User`.`id`, `User`.`username`,
  `User`.`password`, `User`.`name`, `User`.`email`, `User`.`telno`,
  `User`.`race`, `User`.`sex`, `User`.`level`, `User`.`hp`,
  `User`.`hpmax`, `User`.`str`, `User`.`strmax`, `User`.`dex`,
  `User`.`dexmax`, `User`.`int`, `User`.`intmax`, `User`.`cha`,
  `User`.`chamax`, `User`.`energy`, `User`.`credits`,
  `User`.`last_visit`, `User`.`group_id`, `User`.`active`,
  `User`.`token`, `User`.`created`, `User`.`modified` FROM
  `bankaccounts` AS `Bankaccount` LEFT JOIN `users` AS `User` ON
  (`Bankaccount`.`user_id` = `User`.`id`) WHERE `Bankaccount`.`userid` =
  5 LIMIT 1
  Warning: SQL Error: 1054: Unknown column 'Bankaccount.userid' in
  'where clause' in ...cake/libs/model/datasources/dbo_source.php on
  line 463

  Fatal error: Call to undefined method: bankaccount-onerror() in .../
  cake/libs/model/datasources/dbo_source.php on line 596

  have I done something wrong or there is an incompatibility?

  Thanks

  -- M

 --
 (the old fart) the advice is free, the lack of crankiness will cost you

 - its a fine line between a real question and an idiot

 http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Cakephp generates Wrong query in PHP4?

2007-07-07 Thread Samuel DeVore
I am fairly sure that in php 4 you have to do FindByUser_Id I know this used
to be the case due to limitations in php 4  see
https://trac.cakephp.org/ticket/1567 for a ticket on the manual for this.
I hope that one of the Cake Devs can confirm or deny this

Sam D

On 7/7/07, M [EMAIL PROTECTED] wrote:


 CakePHP version: : 1.1.15.5144.

 Hello, the Bankaccount model belongs to User model.

 Now, in BankaccountsController::view method I have this statement:

 $data = $this-Bankaccount-findByUserId( $user_id );

 In PHP 5  it works fine.

 In PHP  4.4.7 it gives this error:

 Query: SELECT `Bankaccount`.`id`, `Bankaccount`.`user_id`,
 `Bankaccount`.`credits`, `Bankaccount`.`created`,
 `Bankaccount`.`modified`, `User`.`id`, `User`.`username`,
 `User`.`password`, `User`.`name`, `User`.`email`, `User`.`telno`,
 `User`.`race`, `User`.`sex`, `User`.`level`, `User`.`hp`,
 `User`.`hpmax`, `User`.`str`, `User`.`strmax`, `User`.`dex`,
 `User`.`dexmax`, `User`.`int`, `User`.`intmax`, `User`.`cha`,
 `User`.`chamax`, `User`.`energy`, `User`.`credits`,
 `User`.`last_visit`, `User`.`group_id`, `User`.`active`,
 `User`.`token`, `User`.`created`, `User`.`modified` FROM
 `bankaccounts` AS `Bankaccount` LEFT JOIN `users` AS `User` ON
 (`Bankaccount`.`user_id` = `User`.`id`) WHERE `Bankaccount`.`userid` =
 5 LIMIT 1
 Warning: SQL Error: 1054: Unknown column 'Bankaccount.userid' in
 'where clause' in ...cake/libs/model/datasources/dbo_source.php on
 line 463

 Fatal error: Call to undefined method: bankaccount-onerror() in .../
 cake/libs/model/datasources/dbo_source.php on line 596

 have I done something wrong or there is an incompatibility?

 Thanks

 -- M


 



-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---