I think the problem is clearly related to preparation .
The function probably doesn't work, in which case $ stmt will be FALSE and therefore does not have the bind_param method as a member.
php mysqli:
mysqli_prepare() FALSE, .
! , SELECT. FALSE, - , , , , .
if($stmt === FALSE)
die("Prepare failed... ");
$stmt->bind_param("i","");
, - :
SELECT d.date
FROM cali_events e
LEFT JOIN cali_dates d
ON e.event_id = d.event_id
WHERE YEARWEEK(d.date) = YEARWEEK(CURRENT_DATE())
AND c.category_id = ?
GROUP BY DAY(d.date)
, :
public function countDaysWithoutEvents()
{
$count = FALSE;
$sql = "SELECT COUNT(d.date) ";
$sql .= " FROM cali_events e ";
$sql .= " LEFT JOIN cali_dates d ON e.event_id = d.event_id ";
$sql .= " WHERE YEARWEEK(d.date) = YEARWEEK(CURRENT_DATE()) ";
$sql .= " AND c.category_id = ? ";
$sql .= " GROUP BY DAY(d.date) ";
$stmt = $this->link->prepare($sql);
if($stmt !== FALSE)
{
$stmt->bind_param('i', $this->locationID);
$stmt->execute();
$stmt->bind_result($count);
$stmt->fetch();
$stmt->close();
}else
die("Error preparing Statement");
return (7 - $count);
}
P.S. , fetch (. )