Please help:
I am trying to create a mysql database within a php script without any success.
I have a Linux operating system with an apache web server and a mysql database server
all on the same machine.I can create a database within the linux-mysql console but when I try to create the database by php programming is not possible.There is a
connection with the database server.
There is no message of error, simply the program can t process the query
“create database if not exists gestion”.
The program is the following:
<?php
error_reporting(E_ALL|E_STRICT);
ini_set(‘display_errors’,true);
$conn=@mysql_connect(“localhost”,”user”,”pass”);
If ($conn){
echo “Connect”;
}else{
echo “There is no connection”;
}
$consult=”CREATE DATABASE IF NOT EXISTS gestion”;
$res=mysql_query($consult,$conn);
If ($res){
echo “Success”;
}else{
echo “Faillure”;
}
?>