I need to pass a var from the parent class to an extend class but need it to keep the value that was set during the running of the main class. the code i have so far is below but isn't keeping the value from the parent class.
The problem is getting the 'v1' value passed to the ext class to use it in a SQL query. Any ideas??
The problem is getting the 'v1' value passed to the ext class to use it in a SQL query. Any ideas??
Code:
class main {
var $v1;
function __consturct() {
}
function someFunc() {
..do stuff..
$v2 = &new ext($this->v1);
..do stuff..
}
}
class ext extends main {
..do stuff..
..get v1 value from parent class..
..use v1 value in SQL query and insert values returned..
}
Comment