diff --git a/conntest.php b/Exc1 SQL/conntest.php similarity index 100% rename from conntest.php rename to Exc1 SQL/conntest.php diff --git a/myform.php b/Exc1 SQL/myform.php similarity index 100% rename from myform.php rename to Exc1 SQL/myform.php diff --git a/Exc1 SQLite/connlite.php b/Exc1 SQLite/connlite.php new file mode 100644 index 0000000..bbed1f8 --- /dev/null +++ b/Exc1 SQLite/connlite.php @@ -0,0 +1,31 @@ +open('test.db'); + } + } + + + $db = new MyDB(); + if(!$db){ + echo $db->lastErrorMsg(); + } else { + // echo "Opened database successfully\n"; + } + + $create_qry ="CREATE TABLE IF NOT EXISTS blogpost(id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT NOT NULL DEFAULT '0', + message TEXT NOT NULL DEFAULT '0', + timestamp DATETIME DEFAULT CURRENT_TIMESTAMP)"; + + + $ret = $db->exec($create_qry); + if(!$ret){ + echo $db->lastErrorMsg(); + } else { + // echo "Table created successfully"; + } + +?> diff --git a/Exc1 SQLite/myform2.php b/Exc1 SQLite/myform2.php new file mode 100644 index 0000000..b81af01 --- /dev/null +++ b/Exc1 SQLite/myform2.php @@ -0,0 +1,100 @@ + + +You forgot to enter your name!"; + }else{ + $errorMessage .= "
there was an error with your form:
\n"); + echo("