Note that $host, $username, $password, and $db_name must be replaced with actual login details for a database.
if (mysql_connect($host,$username,$password)){
mysql_select_db($db_name) or die('Unable to select database');
$query = "CREATE TABLE tbl_name (id int(6) NOT NULL auto_increment,name varchar(15) NOT NULL, PRIMARY KEY (id))";
mysql_query($query);
mysql_close();
echo 'The database was configured successfully!';
}
else{
echo 'There was a problem.';
}
This code will connect to a database and then execute a query that will create a table called "tbl_name" with 2 columns called "id" and "name" respectively.