Am a newbie in PHP and MySQL, how can I create a database with a phone number being the database name? The phone number is in the format of +256720742675. I have tried the code below but keeps on trowing an error.
<?php
$database= $_POST[PhoneNumberTextBox];
//check for MySQL server connection
$connection = mysql_connect("localhost","root","");
if (!$connection)
{
die('Could not connect to database: ' . mysql_error());
}
//Create database
$sql= "CREATE DATABASE $database";
if(!mysql_query($sql,$connection))
{
die('Could not create database'.mysql_error());
}
else
echo"Database Created<br\>";
//Close connection
mysql_close($connection);
?>