-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtables.php
39 lines (36 loc) · 944 Bytes
/
tables.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
28
29
30
31
32
33
34
35
36
37
38
39
<?php
$servername = "localhost";
$username = "root";
$password = "AthlonY2";//enter mysql password
$dbname = "Platform";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
session_start();
$_SESSION['username'] =0;
//sql to drop table
$sql="DROP TABLE SIGNUP";
mysqli_query($conn, $sql);
//$sql="DROP TABLE Rigved";
//mysqli_query($conn, $sql);
//$sql="DROP TABLE Voltura";
//mysqli_query($conn, $sql);
//$sql="DROP TABLE JOURNAL";
//mysqli_query($conn, $sql);
// sql to create table
$sql = "CREATE TABLE SIGNUP(
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(30) NOT NULL,
pass VARCHAR(100) NOT NULL,
email VARCHAR(50),
reg_date TIMESTAMP
)";
if (mysqli_query($conn, $sql)) {
echo "Table SIGNUP created successfully ";
} else {
echo "Error creating table: " . mysqli_error($conn);
}
?>