Database Creation - Procedural way - PHP

<?php // Syntax --->bool define ( string $name , mixed $value [, bool $case_insensitive = false ] ) define("MYSQLPASS","yourpassword"); define("MYSQLHOST", "localhost"); $connection = @new mysqli(MYSQLHOST, MYSQLUSER,MYSQLPASS ); if($connection->connect_error) { die('connection error:' . $connection->connect_error); }else { echo'connected succesfully'; } $databa = "CREATE DATABASE IF NOT EXISTS rkjustice"; if(mysqli_query($connection, $databa)) { echo'database created'; }else { echo'error creating database or database already exists'. mysqli_error($connection); } ?>

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.