
11/07/2002, 14:41
|
 | | | Fecha de Ingreso: noviembre-2001 Ubicación: Vilanova i la Geltrú
Mensajes: 1.942
Antigüedad: 23 años, 4 meses Puntos: 0 | |
Re: Conexión MYSQL? Me da error, éste es el código:
<?
// con esto te conectas
$conn = mysql_connect("localhost", "usuario", "pass");
mysql_select("db");
// con esto ejecutas un query
$rs = mysql_query("SELECT id FROM tabla", $conn);
$fila = mysql_fetch_array($rs);
?>
<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=1>
<TR><TD>&nbsp;nick</TD><TD>&nbsp;nombre&nbsp;</TD></TR>
<?php
while($row = mysql_fetch_array($rs)) {
printf("<tr><td>&nbsp;%s</td><td>&nbsp;%s&nbsp;</td></tr>", $row["nick"],$row["nombre"]);
}
mysql_free_result($rs);
mysql_close($fila);
?>
</table>
<center><p><img border="0" src="http://www.dacoyinternet.com/orale/images/logo/logot.gif" width="218" height="53"></p> |