db; $query = "SELECT q3, ems_qty_in_stock from ecmproducts WHERE id='".$focus->id."';"; $result = $db->query($query); $row = $db->fetchByAssoc($result); $q3 = $row['q3']; $stock = $row['ems_qty_in_stock']; if ( intval($stock) < 3 * intval($q3)) return 1; else return 0; } ?>