Call to a member function on a non object?
What is the above error?
Before anyone talk about OOP, yes I do know Object Oriented Programming, but nevertheless, the error is not very descriptive.
I mean, call to a member function on a non-object means, I guess.... Calling a function that does not belong to an object, but still, I don't get it.
This is the guilty line of code:
//get the Category
$catQuery = catQuery($SubCat);
$catQuery->doquery2($db);
list($SubCat) = $SubCat->getrow();
My apache php log errors say it's the last line, the list().
This is my function
//Returns the query which gets the listing by SubCategory
function catQuery($SubCat) {
$strSQL =
"SELECT
SubCat.Nom AS prodSubCat
FROM
Produit
WHERE
SubCat='$SubCat'";
$q = new Query();
$q->setSQL($strSQL);
return $q;
}
Can anyone help me understand what's wrong?
Thanks