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;
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
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();
3 matches
Mail list logo