I have a problem when creating the database, on the net I found little content about, only meeting how to mount database by phpMyAdmin, but it is via script that I want to create. >
I have the following code:
<?php
$mysqli = new mysqli("localhost","root","");
if($mysqli-> connect_error){
echo "Não foi possível conectar.";
}
$create_db = "CREATE DATABASE 'my_db'";
if($mysqli->query($create_db)){
echo "conexão bem sucedida";
}
else{
echo "falha na conexão";
}
?>
The WampServer does not point to syntax errors. I always have a "connection failure" answer, what's wrong?