View Full Version : object oriented php help

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)

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

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

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

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

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

or a function within the class (a class method) ??