Code has been added to clipboard!

Using a MySQL Port

Example
<?php
  $host = 'host';
  $user = 'user';
  $pass = 'pass';
  // Create connection  
  $conn = mysqli_connect($host, $user, $pass);  	
  // Check connection  	
  if (!$conn) {      
    die("Failed to connect: " . mysqli_connect_error());
  }
  // Create database  	
  $sql = "CREATE DATABASE my_data";  	
  if (mysqli_query($conn, $sql)) {    
    echo "Database creation successful.";
  } else { 
    echo "Failed to create database: " . mysqli_error($conn);
  }
  mysqli_close($conn);  
?>