I have created a class Vacancy which has some variables :
public $salary;
public $id;
...
I am looping through the result of a query and creating a vacancy for each match
Then I adding the vacancy to an array.
$tempVacancy=new Vacancy();
$tempVacancy->salary = mysql_result($result,$i,"salary");
$tempVacancy->id =mysql_result($result, $i, "yid");
//Then when i what to put the created vacancy in an array something happens $vacancies[$i] = $tempvacancy;
<===============Somehow this is not working because
when i try to access vacancies[$i] it is giving the following error:
Fatal error: Call to a member function printVacancy() on a non-object in C:\wamp\www\home\search.php on line 210
Is there a special way to create an array of objects in php??
Thanks in advance!