![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
20/11/2006, 20:54
|
O_O | | Fecha de Ingreso: enero-2002 Ubicación: Santiago - Chile
Mensajes: 34.417
Antigüedad: 23 años, 1 mes Puntos: 129 | |
Algunos usal "list()" tipo www.php.net/list Cita: Ejemplo 2. Otro ejemplo del uso de list()
[php]
<table>
<tr>
<th>Employee name</th>
<th>Salary</th>
</tr> Código PHP: <?php
$result = mysql_query("SELECT id, name, salary FROM employees", $conn);
while (list($id, $name, $salary) = mysql_fetch_row($result)) {
echo " <tr>\n" .
" <td><a href=\"info.php?id=$id\">$name</a></td>\n" .
" <td>$salary</td>\n" .
" </tr>\n";
}
?>
</table> Un saludo,
__________________ Por motivos personales ya no puedo estar con Uds. Fue grato haber compartido todos estos años. Igualmente los seguiré leyendo. |