-
Notifications
You must be signed in to change notification settings - Fork 0
/
connect.php
52 lines (43 loc) · 1.3 KB
/
connect.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
40
41
42
43
44
45
46
47
48
49
50
51
<?php
session_start();
$servername = "localhost";
$username = "root";
$password = "Sahil@Raj1998";
$dbname = "sftaskmanager";
//$DB_name = "dblogin";
try
{
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
//$sql = "INSERT INTO membercredentials (name,password)VALUES ('yooooo','kapoor')";
// use exec() because no results are returned
//$DB_con->exec($sql);
//echo "New record created successfully";
}
catch(PDOException $e)
{
echo $e->getMessage();
}
include_once 'class.user.php';
$user = new user($conn);
//include_once 'class.user.php';
//$user = new USER($DB_con);
/**$servername = "localhost";
$username = "root";
$password = "Sahil@Raj1998";
$dbname = "sftaskmanager";
try {
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "INSERT INTO membercredentials (name,password)VALUES ('sahil Raj','alokkumar')";
// use exec() because no results are returned
$conn->exec($sql);
echo "New record created successfully";
}
catch(PDOException $e)
{
echo $sql . "<br>" . $e->getMessage();
}
$conn = null;**/
?>