0

When I am executing the following code I get the error code described in the header:

function getBrands($b_showAll) {
    global $mysql;

    if($b_showAll==true) {
        $query = $mysql->query("SELECT * FROM producer");
    }

    else {
        $query = $mysql->query("SELECT * FROM producer WHERE (active = 1)");
    }

    $result = array();
    while($row = $query->fetch_array()) {
        $brand = new brand();
        $brand->name = $row['name'];
        $brand->logo = $row['logo'];
        $brand->active = $row['active'];
        array_push($result, $brand);
    }   
    return $result;
}

How to solve this problem?

Tobias Lukoschek
  • 355
  • 1
  • 3
  • 20

0 Answers0