Hi there.
Try doing it this way:
You need to access the class's variable using the $this identifier
e.g.
> class MenueItem {
> var $ID_Menue;
> var $Name;
> var $Parent_ID;
> var $Next_ID;
> var $Prev_ID;
>
>
> function Write() {
> echo "Parent_ID: " . $this->Parent_ID . "<BR>";// Not $MI
> //(no output at all!)
> }
>
>
Regards
-Scott
David Eggler wrote:
> I create a Instance fo the Class MenueItem in Menue. I change the value of
> one of its variables. But when i call the function within MenueItem there
> seems not to be a value:
> The intresting thing is it works with Other variables, even i cant echo
> them, they have a value....
>
> Thanks for help
>
> class Menue {
>
> function Makechilde($somvalue) {
> echo "Next_ID: " . $Parent_ID . "<BR>"; //Works
> $MI->Parent_ID = $Parent_ID;
> echo "Parent_ID: " . $MI->Parent_ID . "<BR>";//correct output
> $MI->write();
>
> }
> }
>
> class MenueItem {
> var $ID_Menue;
> var $Name;
> var $Parent_ID;
> var $Next_ID;
> var $Prev_ID;
>
>
> function Write() {
> echo "Parent_ID: " . $MI->Parent_ID . "<BR>";
> //(no output at all!)
> }
>
> }
>
>
--
//--------------------------------------------//
// Scott Houseman //
// Jam Warehouse http://www.jamwarehouse.com/ //
// Smart Business Innovation //
// +27 21 4477440 / +27 82 4918021 //
//--------------------------------------------//
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php