Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/08/2003, 16:01
Matdor
 
Fecha de Ingreso: junio-2003
Mensajes: 150
Antigüedad: 23 años, 4 meses
Puntos: 0
¿Q puede ser???

q esta mal lo unico q quiero sq me muestre los datos de la tabla links

Código PHP:
<?php
$host
="localhost";
$user = "klan_rd";
$pass = "xxxxxxx";
$data = "klan_rd";
include(
"conex.php");
$link = Conectarse($host,$user,$pass,$data);
$sql = "select * from links";
$result = mysql_query($sql,$link);
while (
$row = mysql_fetch_array($result)) {
echo 
$row["nombre"];
}

mysql_free_result($result);
mysql_close($link);

?>
conex.php
Código PHP:
<?

function Conectarse($host,$user,$pass,$data) 
{ 
if (!(
$link=mysql_connect($host,$user,$pass))) 
{ 
echo 
"Error conectando a la base de datos."; 
exit(); 
} 
if (!
mysql_select_db($data,$link)) 
{ 
echo 
"Error seleccionando la base de datos."; 
exit(); 
} 
return 
$link; 
}

?>