Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/09/2010, 14:23
eke_ps
 
Fecha de Ingreso: septiembre-2010
Mensajes: 101
Antigüedad: 13 años, 7 meses
Puntos: 0
Exclamación no acutaliza la unica que quiero

no actualiza la unica respuesta que quir actualizar

actualiza las otras 3 tambien


les paso un pedazo del codigo

Código HTML:
if(isset($_POST['modificar'])){
	mysql_query("UPDATE tbl_encuestasp SET pregunta='".$_POST['pregunta'] ."' WHERE id=".$_POST['id']);
	//mysql_query("UPDATE tbl_encuestasr set respuesta=".$_POST['respuesta'] ." where idpregunta=".$_POST['id']);
	mysql_query("UPDATE tbl_encuestasr SET respuesta='".$_POST['modopcion1'] ."' WHERE idpregunta=".$_POST['id'])or die(mysql_error());
	//mysql_query("UPDATE tbl_encuestasr set respuesta=".$_POST['modopcion1'] ." WHERE idpregunta=".$_POST['id']);
	

	}






?php if(isset($_GET['m'])){
	   $modificar=mysql_fetch_array(mysql_query("SELECT id,pregunta  FROM tbl_encuestasp WHERE id=".$_GET['id']));
	   $modificaropciones=mysql_query("SELECT id,idpregunta,respuesta FROM tbl_encuestasr WHERE idpregunta=".$_GET['id']);
	   ?>

<form id="Modificar" name="form1"  method="POST" action="adminencuesta.php">
<input type="hidden" name="id" value="<?php echo $_GET['id']; ?>">


<table align="center" border="0">
  <tr>
    <td height="48"width="342">Modifica la pregunta:
    
      <input  name="pregunta" type="text" id="pregunta" value="<?php echo($modificar['pregunta']);?>"  size="40"  maxlength="51" align="left" />
      
      <br /></td>
  </tr>
  	
   <tr><td height="1" bgcolor="#000000"></td></tr>
  <tr>
    <td height="42">Modifica la opcion 1:
    
    <?php $data=mysql_fetch_assoc($modificaropciones);?>
    
    
    
    
    <input name="modopcion1" type="text" id="modopcion1" value="<?php echo($data['respuesta']);?>" size="30"    maxlength="28" /></td>

    
    
  </tr>
   <tr><td height="1" bgcolor="#000000"></td></tr>
  <tr>
    <td height="42">Modifica la opcion 2:
       <?php $data=mysql_fetch_assoc($modificaropciones);?>
      <input name="modopcion2" type="text" id="modopcion2" value="<?php echo($data['respuesta']);?>" size="30"  maxlength="28"/></td>
  </tr>
   <tr><td height="1" bgcolor="#000000"></td></tr>
  <tr>   
    <td height="42">Modifica la opcion 3:
      <?php $data=mysql_fetch_assoc($modificaropciones);?>
      <input type="text" id="modopcion3"  name="modopcion3"size="30" value="<?php echo($data['respuesta']);?>"   maxlength="28"/></td>
  </tr>
   <tr><td height="1" bgcolor="#000000"></td></tr>
  <tr>
    <td height="42">Modifica la opcion 4:
       <?php  /*if($data=mysql_fetch_assoc($modificarocpiones)){
		$opcion4=$data['respuesta'];
	   }else{
			$o="";   
	   }*/?>
       <?php $data=mysql_fetch_assoc($modificaropciones);?>
      <input type="text" id="modopcion4" name="modopcion4" value="<?php echo($data['respuesta']);?>" size="30" maxlength="28"/></td>
  
  </tr>
</table>
<input name="modificar" type="submit" id="modificar"value="modificar" onClick="MM_validateForm('pregunta','','R','opcion1','','R','opcion2','','R');return document.MM_returnValue"   />
</form>