Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Lee Laing
Added: Apr 5, 2018 10:54 AM
Modified: Apr 9, 2018 6:56 PM
Views: 20
Tags: no tags
Create New Database Code
  1. // Create database
  2. $sql = "CREATE DATABASE EnterNewDBNameHere";//ENTER THE DB NAME TO CREATE
  3. if ($conn->query($sql) === TRUE) {
  4.     echo "Database created successfully";
  5. } else {
  6.     echo "Error creating database: " . $conn->error;
  7. }