Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/06/2006, 13:48
luppus
 
Fecha de Ingreso: julio-2003
Mensajes: 45
Antigüedad: 20 años, 8 meses
Puntos: 0
Problemas con mysql.

Estoy en mis inicios y no consigo averiguar estos errores, agradecería enormemente un empujón:

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link
Warning: mysql_query(): supplied argument is not a valid MySQL-Link
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL
Warning: mysql_free_result(): supplied argument is not a valid MySQL
Warning: mysql_close(): supplied argument is not a valid MySQL-Link

Este es mi código:
Código PHP:
// CONEXIÓN CON LA BASE DE DATOS
$conexion mysql_connect(
'localhost',
'root',
'contraseña',
'bd'
);

// SELECCIÓN DE LA BD A UTILIZAR (aunque creo que no hace falta)
$seleccion mysql_select_db('bd',$conexion);
  If (
$seleccion=FALSE) {
     ECHO (
'ERROR al seleccionar la BD');
   };

//CONSULTAR A LA BD
$resultado mysql_query('Select * from tabla',$conexion);

 while (
$fila mysql_fetch_row($resultado)){
   
printf(
     
"(%u) %s - %s<br/>",
     
$fila[0], $fila[1], $fila[2
    );
 }
 
mysql_free_result($resultado);
 
mysql_close($conexion); 

Última edición por Cluster; 20/06/2006 a las 14:11