Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem using parent::

Status
Not open for further replies.

DeepBlerg

Technical User
Joined
Jan 13, 2001
Messages
224
Location
AU
Hi,

I'm having this problem with parent/child relationship with my classes:

Code:
require_once("classes/products.class.php");

class books extends products {

	var $dblink;

	function books($dblink) {
		$this->dblink = $dblink;
		parent::products($this->dblink);
	}

	function update_book($fk_productid, $bookid, $details) {
		parent::update_product($fk_productid, $details);

		$this->update_tuple($details, $bookid);

		return(1);
	}
}

And heres the products.class.php

Code:
class products {

  var $dblink;

	function products($dblink) {
		$this->dblink = $dblink;
	}

	function update_product($productid, $details) {
		$this->update_tuple($details, $productid);

		return(1);
	}
}

What this does at the moment, when I update a book, it updates the book table fine but does not update the products table and I wouldve thought it should because of this line:

parent::update_product($fk_productid, $details);

in the update_book function.

Any ideas?

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top