Marco,

veo lo siguiente:

est�s utilizando la sentencia db_connect() en lugar de
mysql_connect("parametros de conexion") y est� falt�ndote
mysql_select_db(base, link); para seleccionar la base de datos que tiene la
tabla articulo_boletin.

el resto parece estar todo 10 puntos.

Saludos

Juan
Lic. Juan Angel Ringhetti
Direcci�n de Inform�tica
Secretar�a de Investigaci�n, Ciencia y T�cnica
Universidad Nacional de Lan�s

29 de Septiembre 3901 - Remedios de Escalada - Lan�s
Te: 011-6322-9200 int. 217
email: [EMAIL PROTECTED]
-------------------------------------------
Marco,

I can observe the following:

you have the unknown db_connect() sentence instead mysql_connect() and in
the script you haven't got the mysql_select_db(base,link) sentence to reach
a database wich owns the articulo_boletin table.

The rest of your script it's right.

Excuse my english ;-)

Juan


----- Original Message -----
From: "Rolf van de Krol" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 03, 2004 3:46 PM
Subject: RE: [PHP-DB] Problema con MySQL


Hi Marco,

Please use ENGLISH. This mailinglist is english.

Rolf

-----Oorspronkelijk bericht-----
Van: Marco A. Ortiz [mailto:[EMAIL PROTECTED]
Verzonden: zaterdag 31 januari 2004 16:45
Aan: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Onderwerp: RE: [PHP-DB] Problema con MySQL


Buenos d�as a todos:

Espero que alguno de ustedes hable espa�ol y me pueda ayudar a descubrir qu�
est� mal en el siguiente c�digo:

El objetivo de la funci�n  es acceder a una base de Datos (MySQL) y mostrar
los registros que cumplan cierta condici�n.  Si no existe ning�n registro
que cumpla la condici�n, despliega un mensaje informa al usuario de la
situaci�n, de lo contrario, muestra en una tabla cada uno de los registro
encontrados acompa�ados de las opciones "Eliminar" y "Editar".

Por lo menos esto deber�a hacer. El problema es que no muestra el primero de
los registros que cumplen la condici�n.  Le he dado mil vueltas y no he
logrado encontrar el error.

function mostrar_articulos_admin($boletin)
{
if (!$boletin == NULL)
       {
       $conn = db_connect();
    $query = "select id_articulo, titulo_articulo,
autor_articulo from articulo_boletin where id_boletin=$boletin";
    $result = mysql_query($query, $conn);
  $row = 0;
    $hay_arts = mysql_fetch_row ($result);
  if ($hay_arts)
     {
            echo "<h1>Art�culos correspondientes al Bolet�n
$boletin</h1>";
echo "<p>\n
<table width=\"70%\"
align=\"center\" cellspacing=0>\n
  <tr>\n
<td><b>Detalle
Art�culo</b></td>\n
  <td
align=\"center\"><b>Eliminar</b></td>\n
  <td
align=\"center\"><b>Editar</b></td>\n
</tr>";
while ($fila = mysql_fetch_array($result,
MYSQL_NUM))
       {
$row++;
echo "<tr
bgcolor=\"".color_fila($row)."\">\n";
echo
"<td><p><b>$fila[2]</b><br><i>$fila[3]</i></p></td>\n";
echo "<td
align=\"center\"><a href=\"proces.php?action=delart&articulo=$fila[0]\">
<img
src=\"../boletines/ima/eliminar.gif\" border=0></a></td>\n";
echo "<td
align=\"center\"><a href=\"proces.php?action=editart&articulo=$fila[0]\">
<img
src=\"../boletines/ima/editar.gif\" border=0></a></td>\n";
echo "</tr>\n";
}
echo "</table><br></p>";
       }
          else
       {
            echo "<p>No existe ning�n Art�culo asociado a este
Bolet�n.<br><br></p>";
       }
}
else
{
echo "<p>No ha indicado un n�mero de Boletin V�lido,
verifique la informaci�n e intente de nuevo.</p>";
}
}

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to