Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/04/2012, 13:41
afuentealba
 
Fecha de Ingreso: abril-2012
Mensajes: 65
Antigüedad: 11 años, 11 meses
Puntos: 0
No me graba datos del formulario a la base de datos

estoy tratando de ejecutar el siguiente codigo php...

Código:
// formulario pregunta y respuestas

echo "<form method='post' action=''>" ;
	while ($rowPreg = mysql_fetch_assoc($rs)) {
		
		
		echo "<strong>Cod Preg:".$rowPreg['cod_idpregunta']." Cod Delito:" . $cod_delito . "</strong><br><br>";
		echo "<strong>Pregunta asociada</strong>: ".$rowPreg['gls_pregunta']."<br>";
		echo "<p align='left'><input type='radio' name='respuesta'  value='1'><label for='SI'>SI</label></p>";
		echo "<p align='left'><input type='radio' name='respuesta'  value='2'><label for='NO'>NO</label></p>";
		echo "<p align='left'><input type='radio' name='respuesta'  value='3'><label for='NO A'>NO A</label></p>";
		echo "<p align='left'><input type='radio' name='respuesta'  value='4'><label for='NO O'>NO O</label></p>";

//cierro el while
} 
echo "<input type='submit' name='Submit' id='Submit' value='Submit'><hr>";
echo "</form>";

// Guardado temporal
@$pregunta=$rowPreg['cod_idpregunta'];
@$respuesta=$_POST['respuesta'];
if(@$_POST['submit'])
{
echo $s="insert into respuestas(pregunta,respuesta) values('$pregunta','$respuesta')";
echo 'Your Data Inserted';
mysql_query($s);
}
alguien?