I have this code:
$dateInt = intval($date);
$stmt = $this->db->prepare('SELECT * FROM establecimientos WHERE timestamp > ?');
$stmt->bindParam($dateInt);
$stmt->execute();
And I'm receiving this error:
Call to undefined method mysqli_stmt::bindParam()
I'm sure there's something terribly wrong, but I cannot certainly know!
You have 2 mistakes. The bind_param method requires a datatype hint as the first parameter and it is bind_param and not bindParam
$stmt->bind_param('i', $dateInt);
Check the Documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With