Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $dbhost = 'localhost';
- $dbuser = 'usuario_root';
- $dbpass = 'senha_root';
- $conn = new mysqli($dbhost, $dbuser, $dbpass);
- if($conn->connect_error )
- {
- die('Could not connect: %s' . $conn->connect_error);
- }
- echo "Connected successfullynn";
- $sql = "CREATE DATABASE novobd";
- if($conn->query($sql)===TRUE){
- echo "Created the databasen";
- }
- else {
- echo "Failed to create the database: ".$conn->error;
- }
- //Close the database
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement