fix compilation errors; add public folder
This commit is contained in:
10
database.php
10
database.php
@@ -2,8 +2,8 @@
|
||||
$db_file = "db_file.sqlite";
|
||||
|
||||
// create database file when not existent yet
|
||||
if (!file_exists($db_file)) {
|
||||
$db = new PDO('sqlite:' . $db_file);
|
||||
if (!file_exists($db_file)) {
|
||||
$db = new PDO('sqlite:' . $db_file);
|
||||
$db->exec("CREATE TABLE registrations(
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
first_name TEXT,
|
||||
@@ -14,16 +14,16 @@ if (!file_exists($db_file)) {
|
||||
verify_token TEXT,
|
||||
request_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP)");
|
||||
}
|
||||
else {
|
||||
else {
|
||||
// establish connection
|
||||
$db = new PDO('sqlite:' . $db_file);
|
||||
$ins_stmt = $db->prepare("INSERT INTO registrations
|
||||
(first_name, last_name, note, email, username, verify_token)
|
||||
VALUES (:first_name, :last_name, :note, :email, :username, :verify_token);
|
||||
VALUES (:first_name, :last_name, :note, :email, :username, :verify_token)");
|
||||
}
|
||||
|
||||
// set writeable when not set already
|
||||
if (!is_writable($db_file)) {
|
||||
chmod($db_file, 0777);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user