Ver Mensaje Individual
  #20 (permalink)  
Antiguo 07/07/2015, 16:06
Avatar de chronos682
chronos682
 
Fecha de Ingreso: febrero-2004
Ubicación: Tunja - Boyacá - Colombia
Mensajes: 627
Antigüedad: 21 años
Puntos: 69
Respuesta: Repetir una función 3 veces

Si se pueden cambiar dentro del while mura:

Código PHP:
Ver original
  1. @$aux=$_GET['tematicasId'];
  2.  $sql = "SELECT * FROM Evaluaciones WHERE tematicasId='".$aux."'";
  3. $result = mysql_query($sql) or die(mysql_error());
  4. $iNumReg = mysql_num_rows($result);
  5. if ($iNumReg>0)
  6. {
  7.    $i = 0;  
  8. while ($rowEmp = mysql_fetch_assoc($result))
  9.       { ?>
  10.  
  11.  
  12.   <table width="615" border="1">
  13.   <tr>
  14.     <td colspan="3">Pregunta: <?php echo $rowEmp['evaluacionPregunta']; ?></td>
  15.    </tr>
  16.   <tr>
  17.     <td width="38">Opcion</td>
  18.     <td width="486">Respuesta</td>
  19.     <td width="69">Correcta</td>
  20.   </tr>
  21.   <tr>
  22.     <td>a</td>
  23.     <td><?php echo $rowEmp['evaluacionR1']; ?></td>
  24.    <td><input name="<?php echo "respuesta [". $i."]"?>" type="radio" value="1" required/></td>
  25.   </tr>
  26.   <tr>
  27.     <td>b</td>
  28.     <td><?php echo $rowEmp['evaluacionR2']; ?></td>
  29.     <td><input name="<?php echo "respuesta [". $i."]"?>" type="radio" value="2" required/></td>
  30.   </tr>
  31.   <tr>
  32.     <td>c</td>
  33.     <td><?php echo $rowEmp['evaluacionR3']; ?></td>
  34.     <td><input name="<?php echo "respuesta [". $i."]"?>" type="radio" value="3" required/></td>
  35.   </tr>
  36. </table>
  37. <br/><br/>
  38. <?php
  39. $i += 1;
  40. }
  41.  
  42. }
  43.  
  44. ?>
  45.  
  46.   <a href="curso_desarrollo.php?tematicasId=<?php echo $row_Recordset1['tematicasId']; ?>">Regresar</a>

Lo hice desde el celular asi que si no funciona correctamente trata de tomar la idea y adecuarla.
__________________
Si te gustó la respuesta dale +1

HERNÁN G. SIABATO M.
[email protected]