-
Notifications
You must be signed in to change notification settings - Fork 1
/
database.php
28 lines (20 loc) · 847 Bytes
/
database.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
$connect = mysql_connect('localhost', 'root', "");
$sql = 'CREATE DATABASE IF NOT EXISTS cpd2374project ;';
if (mysql_query($sql, $connect)) {
/* echo "Database cpd2374project Created Successfully<br>"; */
} else {
echo "Error Creating Database:" . mysql_error() . "<br>";
}
$databaseselect = mysql_select_db('cpd2374project', $connect);
if (!$databaseselect) {
die('can\'t use cpd2374project : ' . mysql_error() . '<br>');
}
$sql = "CREATE TABLE IF NOT EXISTS accounts (emailaddress VARCHAR(255), firstname VARCHAR(255), lastname VARCHAR(255), password VARCHAR(255), Hint VARCHAR(255), hintAnswer VARCHAR(255))";
if (mysql_query($sql, $connect) === true) {
/* echo "Table accounts Created successfully<br>"; */
} else {
echo "Error Creating Table:" . mysql_error() . "<br>";
}
//include 'registration.php';
?>