ese fue error mio. XD
Código PHP:
Ver original<?php
$nombre_bd = 'prueba';
$conectar = mysql_connect("localhost", "root", "cyDsCr2dMTYRCjaa"); if (!$conectar) {
echo "No se ha podido conectar al servidor";
} else {
$crear = mysql_query("CREATE DATABASE $nombre_bd", $conectar); $sql = "CREATE TABLE " . $nombre_bd . ".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 ;
";
}
?>
por no probar los códigps antes de postearlos
Cita: De todas formas no creo que sea lo mejor crear una BD por usuario, imagínate las miles de BD que podrías llegar a tener.
eso mismo dije yo