Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/09/2008, 03:50
joseda76
 
Fecha de Ingreso: julio-2007
Mensajes: 47
Antigüedad: 16 años, 9 meses
Puntos: 0
problema al crear formulario tras realizar consulta en base de datos

Mi problema es que quiero crear un formulario, segun la conslulta realizada en la base de datos. El codigo es el siguiente:






<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Evaluacion tutoria</title>
</head>

<body>
<h2 align="center">EVALUACIÓN TUTORIA</h2>
<hr />

<?php
include("../paginasphp/getuser.php");
include("../paginasphp/conectar_bbdd.php");
$tipo='A';

$sql="SELECT texto, id FROM preguntas WHERE activo='S' AND tipo='A'";
$resultado= mysql_query($sql);
$i=0;
while($row = mysql_fetch_assoc($resultado))
{
$array[$i]=$row['texto'];
$numero=$row['id'];
$identificador[$i]=$tipo.$numero;
echo $identificador[$i];
$i++;
}
mysql_close($dp); //cierra la conexion

$contador=$i;
$i=0;
?>


<!-- A PARTIR DE AKI ESTA EL ERROR, como se puede usar un bucle para html-->


for($i=0; $i<$contador; $i++)
{
<p><?php echo $array[$i] ?></p>
<blockquote><t>NS/NC<input name="<?php echo $identificador[$i] ?>" type="radio" value="0"></t>
<t>1<input name="<?php echo $identificador[$i] ?>" type="radio" value="1"></t>
<t>2<input name="<?php echo $identificador[$i] ?>" type="radio" value="2"></t>
<t>3<input name="<?php echo $identificador[$i] ?>" type="radio" value="3"></t>
<t>4<input name="<?php echo $identificador[$i] ?>" type="radio" value="4"></t>
<t>5<input name="<?php echo $identificador[$i] ?>" type="radio" value="5"></t></blockquote>
}




</body>
</html>