note 118600 deleted from function.mysql-create-db by cmb
| From: | cmb@php.net | Date: | Sat, 09 Jan 2016 01:31:12 +0000 |
| Subject: | note 118600 deleted from function.mysql-create-db by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-204628@lists.php.net to get a copy of this message | ||
Note Submitter: gs93907 at gmail dot com
----
Hello,
Please change line of if-condition as
:- if(mysqli_query($link, $sql))
or anyone just paste it and run your IDE...
<?php
$link = mysqli_connect("localhost", "root", "");
if(!$link)
{
die('Not connected with Mysql..'.mysqli_error());
}
$sql = 'CREATE DATABASE through_php';
if(mysqli_query($link, $sql))
{
echo "Successfully created database through_php";
}
else {
echo 'Database not created "through_php"'. mysqli_error($link);
}
// At the end just Close the link.
mysqli_close($link);
?>