[PHP] Weird problem with objects

2004-01-23 Thread Mark Cubitt
hi, I have a shopping cart I'm having probs with. I have a cart class that starts like this: CODE require_once(class_database.php); // Database Class require_once(class_accessory.php); // Accessory Class require_once(class_order.php); // Order Class class cart { var $database;

Re: [PHP] Weird problem with objects

2004-01-23 Thread Stuart
Mark Cubitt wrote: $this-$database = new database(); $this-$accessory = new accessory(); $this-$order = new order(); These should be... $this-database = new database(); $this-accessory = new accessory(); $this-order = new order(); You don't want the

[PHP] Re: RE : [PHP] Weird problem with objects

2004-01-23 Thread Stuart
Vincent DUPONT wrote: what do you mean by this :Additionally, you might want to assign the reference of the new objects otherwise PHP will create a new object and then make a copy of it - not very efficient. Like so... $this-database = new database(); $this-accessory = new accessory();