add code from login in php (not finished yet)
This commit is contained in:
@@ -15,6 +15,17 @@ function db_connect(){
|
||||
}
|
||||
}
|
||||
|
||||
function init_db() {
|
||||
$dbh = db_connect();
|
||||
$sql = "CREATE TABLE user (
|
||||
u_id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
u_email VARCHAR(100) NOT NULL UNIQUE,
|
||||
u_pw VARCHAR(100) NOT NULL
|
||||
)";
|
||||
|
||||
|
||||
$dbh->exec($sql);
|
||||
}
|
||||
|
||||
// Test:
|
||||
// db_connect();
|
||||
13
Zweites Jahr/unterrichts_projekt/inc/db_run_init.php
Normal file
13
Zweites Jahr/unterrichts_projekt/inc/db_run_init.php
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
<h1> Init DB</h1>
|
||||
|
||||
<h2> Tables </h2>
|
||||
|
||||
<?php
|
||||
|
||||
require_once "db_connection_function.php";
|
||||
|
||||
|
||||
init_db();
|
||||
|
||||
echo "finished. DB initialized!";
|
||||
Reference in New Issue
Block a user