jaja pues pensé que eso querias ¬¬¡
para crear en la misma bd es pura lógica :/
Código PHP:
<?php
if (isset($_POST['create'])) {
$nombre_bd = $_POST['nombre_user'];
$conectar = mysql_connect("localhost", "root", "");
if (!$conectar) {
echo "No se ha podido conectar al servidor";
} else {
$crear = mysql_query("CREATE DATABASE $nombre_bd", $conectar);
$sql = "CREATE TABLE productos (`foto_id` int(11) NOT NULL AUTO_INCREMENT,
`producto` varchar(100) NOT NULL DEFAULT '',
`nombre` varchar(100) NOT NULL DEFAULT '',
`descripcion` char(65) NOT NULL,
`precio` double NOT NULL DEFAULT '0',
PRIMARY KEY (`foto_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=46 ;
";
$sql2 = "CREATE TABLE " . $nombre_bd . ".tabla2 (`foto_id` int(11) NOT NULL AUTO_INCREMENT,
`producto` varchar(100) NOT NULL DEFAULT '',
`nombre` varchar(100) NOT NULL DEFAULT '',
`descripcion` char(65) NOT NULL,
`precio` double NOT NULL DEFAULT '0',
PRIMARY KEY (`foto_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=46 ;
";
$sql3 = "CREATE TABLE " . $nombre_bd . ".tabla3 (`foto_id` int(11) NOT NULL AUTO_INCREMENT,
`producto` varchar(100) NOT NULL DEFAULT '',
`nombre` varchar(100) NOT NULL DEFAULT '',
`descripcion` char(65) NOT NULL,
`precio` double NOT NULL DEFAULT '0',
PRIMARY KEY (`foto_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=46 ;
";
}
}
?>