I want to insert data to my database stored in SQLite but, when I pass my query to pdo prepare it's retruns false and giving me this message: Fatal error: Uncaught Error: Call to a member function execute() on boolean.
Here is My PHP code:
$ql = "INSERT INTO customer_in (`ledger_id`, `daybook_id`, `description`, `amount`, `date`) VALUES (31, 141, '', 5000, '07/02/2018')";
try {
$con = new Connection();
$conn = $con->connect();
$conn->exec("SET NAMES utf8");
$stmt = $conn->prepare($q1);
$results = $stmt->execute();
}catch (PDOException $e) {
// this is rolback fanction
$conn->rollback();
echo "query is not exe";
}