Ver Mensaje Individual
  #7 (permalink)  
Antiguo 21/01/2010, 17:34
Lechu_
 
Fecha de Ingreso: enero-2010
Mensajes: 128
Antigüedad: 14 años, 3 meses
Puntos: 2
Respuesta: PHP no se conecta con mysql

Copie el codigo (y complete los datos), pero no hace nada.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin ttulo</title>
</head>

<body>

<?php
function Conectarse()
{
if (!($link=mysql_connect("localhost","root","miClave ")))
{
echo "Error conectando a la base de datos.";
exit();
}

if (!mysql_select_db("mascotas",$link))
{
echo "Error seleccionando la base de datos.";
exit();
}
return $link;
}
$link=Conectarse();

?>
</body>
</html>