Re: why am I getting this undefined index error?

2007-11-29 Thread Luke

nobody?

On Nov 28, 10:41 am, Luke [EMAIL PROTECTED] wrote:
 I am trying to set up associations between my orders model and my
 orderitems model. It seems to be working except for this error I'm
 getting. What am I doing wrong? (see screenshot below)

 Here are my models:

 ?php
 class OrderItem extends AppModel {
var $name = 'OrderItem';
var $belongsTo = array('Order' =
array('className'  = 'Order',
  'foreignKey' = 'order_id'
)
  );}

 ?

 ?php
 class Order extends AppModel {
var $name = 'Order';

var $hasMany = array('OrderItem' =
  array('className' = 'OrderItem',
'order' = 'OrderItem.status_id
 DESC',
'foreignKey'= 'order_id',
'dependent' = true
  )
   );}

 ?

 here is a screenshot of the error I am getting:

 http://pleaseproof.com/luke/cake.gif
--~--~-~--~~~---~--~~
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: why am I getting this undefined index error?

2007-11-29 Thread powtac

I had the same Undefined index... error. After I changed some things
manualy at the database. But when I bake the model again it was
resolved.
--~--~-~--~~~---~--~~
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: why am I getting this undefined index error?

2007-11-29 Thread Kyo


Those errors won't get you into any trouble in reality.
If you want to remove them, just try something like this in your view:

?php if($output['OrderItem']['id']): ?
?php echo $output['OrderItem']['id'] ?
?php endif; ?

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



why am I getting this undefined index error?

2007-11-28 Thread Luke

I am trying to set up associations between my orders model and my
orderitems model. It seems to be working except for this error I'm
getting. What am I doing wrong? (see screenshot below)

Here are my models:

?php
class OrderItem extends AppModel {
   var $name = 'OrderItem';
   var $belongsTo = array('Order' =
   array('className'  = 'Order',
 'foreignKey' = 'order_id'
   )
 );
}
?

?php
class Order extends AppModel {
   var $name = 'Order';

   var $hasMany = array('OrderItem' =
 array('className' = 'OrderItem',
   'order' = 'OrderItem.status_id
DESC',
   'foreignKey'= 'order_id',
   'dependent' = true
 )
  );
}
?

here is a screenshot of the error I am getting:

http://pleaseproof.com/luke/cake.gif
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---