$startDate = time(); $endDate = mktime(date("h"), date("i"), date("s"), date("m") , date("d")+1, date("Y")); $stmt = $this->conn->prepare("INSERT INTO timer(id, startDate, range, endDate) values(?, ?, ?, ?)"); $stmt->bind_param("siii", $id, $startDate, $range, $endDate); $result = $stmt->execute(); $stmt->close();
Mistake:
check the manual that corresponds to your MySQL server version for the right syntax to use near 'range, endDate) values(?, ?, ?, ?)' at line 1
show create table timer
, $ range can be empty for you, but they are mandatory in the database 2) showshow create table timer
so that they know what should be written there 3) show the error itself - BOPOH`range`
range
in quotes (i.e.`range`
) - BOPOH