![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
14/03/2005, 08:20
|
| | Fecha de Ingreso: diciembre-2004
Mensajes: 128
Antigüedad: 20 años, 1 mes Puntos: 1 | |
Pienso que remplazando "pregunta1" por una variable, y haciendo un FOR, asi:
<?php
include("conex.phtml");
$link=Conectarse();
$result=mysql_query("select * from prueba",$link);
?>
for($i=1;$i<13;$i++){
<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=1>
<TR><TD> <B>Nombre</B></TD> <TD> <B>Apellidos</B> </TD><TD> <B>email</B> </TD><TD> <B>pregunta$i</B> </TD></TR>
<?php
while($row = mysql_fetch_array($result)) {
printf("<tr><td> %s</td> <td> %s </td><td> %s </td><td> %d </td></tr>", $row["Nombre"], $row["Apellidos"], $row["email"], $row["pregunta$i"]);
}
mysql_free_result($result);
mysql_close($link);
?>
</table>
}
Todo queda igual salvo eso. |