...

View Full Version : object oriented php help



esthera
07-18-2007, 07:48 PM
i'm new to object oriented php

now I have a class

and wihtin the class I want to call a function with the $id
How do I call a function (that returns an array) and put it to an array.

I tried
$this->product= getM($this-->id);
but it's not working?
any suggestions as well for some good tutorial on this would be helpful.




function getM($id)

Mwnciau
07-18-2007, 07:50 PM
Can't you just do


$this->variable = array(1, 2, 3, 4, 5);

esthera
07-18-2007, 07:56 PM
well the function opens the db and pullls a recordset to the array it returns

i'm having trouble calling the functions with the id

Brandoe85
07-18-2007, 08:10 PM
You will have to post more code for us to help.

firepages
07-19-2007, 04:17 AM
a function external to the class ..


<?
$this->product=getM($this->id);
?>
or a function within the class (a class method) ??
<?
$this->product=$this->getM($this->id);
?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum