-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.php
35 lines (28 loc) · 1.18 KB
/
config.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
<?php
//$url='insertdata.php';
try
{
$dbhandler = new PDO('mysql:host=127.0.0.1;dbname=dept_portal','root','');
//echo "Connection is established...<br/>";
$dbhandler->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
$url='courselist.php';
$sql="CREATE TABLE Student(StuID INT(11) PRIMARY KEY AUTO_INCREMENT "
. ",CollegeID VARCHAR(30) NOT NULL,Name VARCHAR(30) NOT NULL, Password VARCHAR(30) NOT NULL,"
. "RePassword VARCHAR(30) NOT NULL, ContactNo VARCHAR(15) NOT NULL, Email VARCHAR(50) NOT NULL)";
if(!$url)
{
$query=$dbhandler->query($sql);
//echo "Table is created successfully";
}
else
{
//echo"Table already created";
}
//header('Location: '.$url);
}
catch(PDOException $e)
{
echo $e->getMessage();
die();
}
?>