<?php
require_once '../vendor/autoload.php';
use Medoo\Medoo;
echo "Hello World";
$database = new medoo([
'database_type' => 'sqlite',
'database_file' => '../storage/database/db'
]);
When I run it, I get two errors as follows:
( ! ) Fatal error: Uncaught PDOException: SQLSTATE[HY000] [14] unable to open database file in [...]/vendor/catfan/medoo/src/Medoo.php on line 188
( ! ) PDOException: SQLSTATE[HY000] [14] unable to open database file in [...]/vendor/catfan/medoo/src/Medoo.php on line 188
Line 188 of Medoo.php:
$this->pdo = new PDO('sqlite:' . $options['database_file'], null, null, $this->option);
The textbook I'm using says that SQLite creates the database file if it doesn't exist, which didn't happen. What could be wrong?
Learning PHP out of a book from SitePoint.
This is my
index.php
file:When I run it, I get two errors as follows:
Line 188 of Medoo.php:
$this->pdo = new PDO('sqlite:' . $options['database_file'], null, null, $this->option);
The textbook I'm using says that SQLite creates the database file if it doesn't exist, which didn't happen. What could be wrong?