I have included this snippet from my class. The method getAllReelTest() selects products with a specific category number from a MYSQL db.
This is the function stored in (reelClass) class. The class has various static variables ie table1, table2, table3 etc
[php]
reelClass{
static $table3 =‘itm_details’;
public function getAllReelTest($category){
$sql = “SELECT * FROM '”.self::$table3 ."’
WHERE itm_cat = ‘" . $category . "’
ORDER
BY id
ASC";
$stmt = mysqli_query($this->connection,$sql);
while($result = mysqli_fetch_array($this->connection,$stmt))
{
print_r($result);
}
}
[/php]
code to instantiate the class and call the method
[php]
$reel = new reelClass();
$reel->getAllReelTest(2)
[/php]
The error I am getting is as follows.
mysqli_fetch_array() expects parameter 1 to be mysqli_result, object given
I think this is probably because i have written my sql wrong in some way. Please can someone help?