<?php
//fix the line below also add include for logging
//$_SESSION['db_name'] = '%relativeSiteAssetPath%/sc_assets/db/calendar.db';
$_SESSION['crudpath'] = "https://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
session_start();
$crudpath = $_SESSION['crudpath'];

$conn = new PDO('sqlite:%relativeSiteAssetPath%/sc_assets/db/calendar.db');
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
//connect the table- create it if it doesn't exist
$query = "CREATE TABLE IF NOT EXISTS events2 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, title TEXT, ev_start TEXT, ev_end TEXT, event_url TEXT, details TEXT, venue TEXT, venue_add TEXT, social_url TEXT, sponsors TEXT, textColor TEXT, borderColor TEXT, backgroundColor TEXT)";
$conn->exec($query);

?>
