Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html lang="en">
- <body>
- <?php
- $servername = "localhost";
- $username = "username";
- $password = "password";
- // 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 myDB";
- if ($conn->query($sql) === TRUE)
- {
- echo "Database created successfully";
- }
- else
- {
- echo "Error creating database: " . $conn->error;
- }
- $conn->close();
- $servername = "localhost";
- $username = "username";
- $password = "password";
- $dbname = "myDB";
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<html lang="en">
- <body>
- <?php
- $servername = "localhost"' at line 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement