summaryrefslogtreecommitdiff
path: root/Lab06/create_db.php
diff options
context:
space:
mode:
Diffstat (limited to 'Lab06/create_db.php')
-rw-r--r--Lab06/create_db.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/Lab06/create_db.php b/Lab06/create_db.php
new file mode 100644
index 0000000..c220148
--- /dev/null
+++ b/Lab06/create_db.php
@@ -0,0 +1,23 @@
+<?php
+$servername = "localhost";
+$username = "it";
+$password = "smit#1234";
+
+//Create connection
+$conn = new mysqli($servername, $username, $password);
+
+//Check connection
+if ($conn->connect_error) {
+ die("Connection failed: " . $conn->connect_error);
+}
+
+//Create database
+$sql = "CREATE DATABASE it_202000096";
+if ($conn->query($sql) === TRUE) {
+ echo "Database created successfully";
+} else {
+ echo "Error creating database: " . $conn->error;
+}
+
+$conn->close();
+?>