title: make a mysql query after click in a row of Jquery Datatables
body: <p>I'm trying to do a master-detail table using JQuery Datatables. I have a table <strong>facture</strong> and a table <strong>lines</strong>. The table <strong>facture</strong> has got a code for PK, and the client name. In the table <em>lines</em>* I have got the code of the facture, the number of the line, the article and the price. I want to click in one row of the table <strong>facture</strong> and it may show the lines for this facture in the table <strong>lines</strong>.
  I'm sorry if I'm not explaining well. If you don't understand what I'm tying to do I'll try to explain better.
  Now I have this code for show all the <strong>line</strong> table.</p>
  
  <p><strong>js function for show the query in a div</strong></p>
  
  <pre><code>function objetoAjax(){
              var xmlhttp=false;
            try {
              xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
          } catch (e) {
              try {
                  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
              } catch (E) {
                  xmlhttp = false;
                }
            }
  
          if (!xmlhttp &amp;&amp; typeof XMLHttpRequest!='undefined') {
              xmlhttp = new XMLHttpRequest();
          }
          return xmlhttp;
      }
  
      function MostrarConsulta(datos){
          divResultado = document.getElementById('mus');
          ajax=objetoAjax();
          ajax.open("GET", datos);
          ajax.onreadystatechange=function() {
              if (ajax.readyState==4) {
                  divResultado.innerHTML = ajax.responseText
              }
          }
          ajax.send(null)
      }
  </code></pre>
  
  <p><strong>php code for the query</strong></p>
  
  <pre><code>include"conexion.php";
  mysql_connect($servidor, $usuario, $clave)or die (mysql_errno().mysql_error());
  mysql_select_db($basedatos)or die (mysql_errno().mysql_error());
  $result=mysql_query("SELECT Serie, Numeroas, Numlinea, Codart, Cant, Descripcion, Precio, Tipoiva, Subtotal FROM PRESUP_D");
  echo "&lt;table border=1 collapse=\"collapse\" bgcolor=\"white\"&gt;";
      echo "&lt;tr&gt;";
      while($field=mysql_fetch_field($result)){   
          echo"&lt;td&gt;&lt;b&gt;$field-&gt;name&lt;/b&gt;&lt;/td&gt;"; 
      }
      echo "&lt;/tr&gt;";
      while($row=mysql_fetch_row($result)){   
          echo "&lt;tr&gt;";
          for($i=0;$i&lt;mysql_num_fields($result);$i++){    
              echo "&lt;td&gt;$row[$i]&lt;/td&gt;";   
          }
          echo "&lt;/tr&gt;";
      }
      echo "&lt;/table&gt;";
  mysql_close();
  </code></pre>
  
  <p>I call the function with a form with an event onsubmit="MostrarConsulta('linea.php'); return false.
  It show all the table and I want to get the value of the selected row in table <strong>facture</strong> and do this query with that.</p>
  
  <p>Regards.</p>