function conectar() { $host="qqq386.greenvalleyberries.com"; $base_de_datos = "qqq386"; $db_usuario = "qqq386"; $db_password = "Polospos123"; if (!($link = mysql_connect($host, $db_usuario, $db_password))) { echo "Error conectando a la base de datos."; exit(); } if (!mysql_select_db($base_de_datos, $link)) { echo "Error seleccionando la base de datos."; exit(); } return $link; } $db = conectar(); ?>