passing a value for a sql query from a boostrap modal
===

im using twitter bootstrap for a proyect. been working things out by myself, but im kinda lost now with this and im not planning on giving up :D. im new to php so pls bear with me.
i really been trying to debug this myself.sorry for my english.

ok, so i have this: 

    if (isset($_POST['textarea'])){
         
        $proceso = mysql_prep($_POST['proceso']);
        $tecnico = mysql_prep($_POST['tecnico']);
	$observacion = mysql_prep($_POST['textarea']);
	$doctor = mysql_prep($_POST['doctor']);
                
        $query = "UPDATE datos SET n_proceso ='{$proceso}',tecnico='{$tecnico}',observaciones='{$observacion}' WHERE doctor ='{$doctor}'";
	$result = mysql_query($query,$connection);
             if ($result) {
		// Success!
		redirect_to("index.php");
	} else {
		// Display error message.
		echo "<p> Insert Failed</p>";
		echo "<p>" . mysql_error() . "</p>";
	}
    }

this is what im using to update the db. and this.

    <script>
	    $(document).ready(function()  
	    {  
	    $("table[id$='princ'] td:nth-child(8)").live('click',function(event)  
	    {  
	    //Prevent the hyperlink to perform default behavior  
	    event.preventDefault();  
	    var $td= $(this).closest('tr').children('td');  
	    var doctor= $td.eq(0).text();  
	    var paciente= $td.eq(1).text();  
	    var boleta=$td.eq(2).text();
	    var caja=$td.eq(3).text();
	    var trabajo=$td.eq(4).text();
	    var proceso=$td.eq(5).text().replace(/\s/g, '');
	    var tecnico=$td.eq(6).text().replace(/\s/g, '');
	    $(".modal-body #doctor").val(doctor);
	    $(".modal-body #paciente").val(paciente);
	    $(".modal-body #boleta").val(boleta);
	    $(".modal-body #caja").val(caja);
	    $(".modal-body #trabajo").val(trabajo);
	    $(".modal-body #proceso").val(proceso);
	    $(".modal-body #tecnico").val(tecnico);
	    $('#myModal').modal('show');
	    }  
	    );  
	    });  
	</script>

This is the js code im using to send data i have on a dinamically generated table to the boostrap modal.

ok this is how it works. i have a php page wich shows data on a dinamically generated table, and the table has an update link which brings up a boostrap modal with some noneditable data from the table, but i have two fields that are editable proceso and tecnico, now the problem is that when i run the query as it is nothing happens, it doesnt update anything. but !!!!!, if i do this:

    UPDATE datos SET n_proceso ='{$proceso}',tecnico='{$tecnico}',observaciones='{$observacion}' WHERE doctor ='jhon smith'";

it works, it finds "jhon smith" on the db and updates the table, ive tried many things but no success. could anyone help me ?

this is the code for the modal:

   

     <div class="modal hide" id="myModal">
        <form action="index.php" class="form-horizontal" method="POST">
        <div class="modal-header">
         <button class="close" data-dismiss="modal">×</button>
         <h3>Informacion de Caso</h3>
        </div>
        <div class="modal-body">
            <pre>
            Caja:     <input class="input-mini" type="text" name="caja" id="caja" disabled="disabled">   Boleta: <input class="input-mini" type="text" name="boleta" id="boleta" disabled="disabled"/>
            Doctor:   <input type="text" name="doctor" id="doctor" disabled="disabled"/>
            Paciente: <input type="text" name="paciente" id="paciente"  disabled="disabled"/>
            Trabajo:  <input type="text" name="trabajo" id="trabajo"  disabled="disabled"/>  
            Proceso:  <select id="proceso" name="proceso">
                        <option value="proc"></option>
                        <option value="Vaciado">Vaciado</option>
                        <option value="Evaluacion">Evaluacion</option>
                        <option value="Autorizacion">Autorizacion</option>
                        <option value="Correccion">Correccion</option>
                        <option value="Encerado">Encerado</option>
                        <option value="Revestido">Revestido</option>
                        <option value="Colado">Colado</option>
                        <option value="Diseño">Diseño</option>
                        <option value="Ceramica">Ceramica</option>
                        <option value="Control de Calidad">Control de Calidad</option>
                        <option value="Facturacion">Facturacion</option>
                      </select>    
            Tecnico:  <select id="tecnico" name="tecnico">
                        <option value="proc"></option>
                        <option value="JavierPineda">Javier Pineda</option>
                        <option value="AmauryGarcia">Amaury Garcia</option>
                        <option value="AnaFlorez">Ana Florez</option>
                        <option value="LarryMejia">Larry Mejia</option>
                        <option value="LeninBuelvas">Lenin Buelvas</option>
                        <option value="BelserSandoval">Belser Sandoval</option>
                        <option value="ElianaDonado">Eliana Donado</option>
                        <option value="FabianMedina">Fabian Medina</option>
                        <option value="IvanSanchez">Ivan Sanchez</option>
                        <option value="JairoDonado">Jairo Donado</option>
                        <option value="JessicaJimenez">Jessica Jimenez</option>
    		    <option value="JorgeMartinez">Jorge Martinez</option>
    		    <option value="JorgeOrtiz">Jorge Ortiz</option>
    		    <option value="JoseLuisPacheco">Jose Luis Pacheco</option>
    		    <option value="OrlandoBlanquicet">Orlando Blanquicet</option>
    		    <option value="SilviaPerez">Silvia Perez</option>
    		    <option value="YilibiCaballero">Yilibi Caballero</option>
    		    <option value="DayanaMartinez">Dayana Martinez</option>
    		    <option value="LuciaLopez">Lucia Lopez</option>
    		    <option value="LuisPineda">Luis Pineda</option>
    		    <option value="TatianaCastro">Tatiana Castro</option>
    		    <option value="AdalbertoPerez">Adalberto Perez</option>
    		    <option value="AngelGrau">Angel Grau"</option>
    		    <option value="JaimeSantamaria">Jaime Santamaria</option>
    		    <option value="JesusMartinez">Jesus Martinez</option>
    		    <option value="JulyMartinez">July Martinez</option>
    		    <option value="KellysVivero">Kellys Vivero</option>
    		    <option value="LaureanoViaña">Laureano Viaña</option>
    		    <option value="LuisPerez">Luis Perez</option>
    		    <option value="NelsonCorcho">Nelson Corcho</option>
    		    <option value="ZeniaOrozco">Zenia Orozco</option>
    		    <option value="ArielPorras">Ariel Porras</option>
    		    <option value="CarmeloHoyos">Carmelo Hoyos</option>
    		    <option value="EinerPineda">Einer Pineda</option>
    		    <option value="JoseDeLaVictoria">Jose De La Victoria</option>
    		    <option value="LuisSanchez">Luis Sanchez</option>
                      </select>
     Observaciones:
            <textarea class="field span12" id="textarea" name="textarea" rows="5" >
            </textarea>
            </pre>
        </div>
        
              <div class="modal-footer">
                  <a href="#" class="btn" data-dismiss="modal">Cerrar</a>
                  <a href="#" class="btn btn-primary" type="submit" method="post" name="modal" id="modal">Guardar Cambios</a>
                  
                  <button class="btn btn-primary" type="submit" >Save changes</button>
                  
                  
              </div>
        </form>
    </div>