![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
#1
<?php
$server='localhost';
$database='world';
$user='root';
$pass='';
/* primero generamos la conexion */
$enlace = mysql_connect($server, $user, $pass);
mysql_select_db($database, $enlace);
/* generamos la peticion sql */
$result = mysql_query("SELECT name, continent, region FROM country", $enlace);
echo "<table border = '1'> \n";
echo "<tr> \n";
echo "<td><b>Nombre del Pais</b></td> \n";
echo "<td><b>Continente</b></td> \n";
echo "<td><b>Region</b></td> \n";
echo "</tr> \n";
/* almacenamos en un array $row, los valores que vamos recibiendo */
while ($fila = mysql_fetch_array($result))
{
echo "<tr> \n";
echo "<td>$fila[name]</td> \n";
echo "<td>$fila[continent]</td> \n";
echo "<td>$fila[region]</td> \n";
echo "</tr> \n";
}
echo "</table> \n";
?>
#2
$server='localhost';
$database='world';
$user='root';
$pass='';
/* primero generamos la conexion */
$enlace = mysql_connect($server, $user, $pass);
mysql_select_db($database, $enlace);
/* generamos la peticion sql */
$result = mysql_query("SELECT SHOW DATABASE ", $enlace);
echo "<table border = '1'> \n";
echo "<tr> \n";
echo"<td><b>''</b></td> \n";
echo"<td><b>''</b></td> \n";
echo"<td><b>''</b></td> \n";
echo "</tr> \n";
/* almacenamos en un array $row, los valores que vamos recibiendo */
while ($fila = mysql_fetch_array($result))
{
//echo "<tr> \n";
//echo "<td>$fila[name]</td> \n";
//echo "<td>$fila[continent]</td> \n";
//echo "<td>$fila[region]</td> \n";
//echo "</tr> \n";
}
echo "</table> \n";
?>
<?php
$Qshow = mysql_query("show databases") or die (mysql_error());
$RBShow = mysql_fetch_array($Qshow);
if (isset($_POST['enviar']))
{
$server='localhost';
$user='root';
$pass='';
$db='strangers';
$enlace = mysql_connect($server, $user, $pass);
if (! mysql_query("CREATE DATABASE $_POST[db]", $enlace))
echo "<h2>No se creo la base de datos</h2>";
}
else
{
?>
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST">
<h3>Formulario para crear una base de datos</h3><br />
Nombre de la Base de Datos
<input type="text" name="db" />
<input type="submit" name="enviar" value="Crear" />
</form>
<?php
}
?>
A X SIACA ESTOY USANDO EL XAMPP