title: Jqgrid populate a select from a MySql query
body: <p>I have some issues trying to populate a select in the editform from a Mysql query. I was reading some blogs but I cant find the solution. Below I attach the some code.</p>
  
  <p>This is the collmodel:</p>
  
  <pre><code>jQuery("#grid_pacientes").jqGrid({
      url:'conec_paciente.php',
  datatype: "json",
  //loadonce: true,
      //
      colNames:['id','Nombre','Apellido','Telefono','Obra Soc'],
  colModel:[
      {name:'id_paciente',index:'id_paciente', width:40, sorttype:'int'},
      {name:'nombre',index:'nombre', width:100,editable:true,editoptions:{size:10},resizable:false, sorttype:'text'},
      {name:'apellido',index:'apellido',width:100, editable: true,resizable:false, sorttype:'text'},
      {name:'telefono',index:'telefono',width:100, editable: true,resizable:false, sorttype:'int'},
      {name:'id_obra',index:'id_obra',width:100, editable: true,resizable:false, sorttype:'int',edittype:"select"
             }
          ],
  </code></pre>
  
  <p>The last coll (id_obra) is the one that I need to fill.</p>
  
  <p>This is the php page where I do the MySql query:</p>
  
  <pre><code>    &lt;?php
  include_once 'lib.php';
  $conexion= mysql_connect($dbhost, $dbuser, $dbpassword);
  mysql_select_db($database, $conexion);
  $result = mysql_query("SELECT id_obra, nombre
                         FROM obras", $conexion) or die(mysql_error());
  $i=0;
  while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
      $responce-&gt;rows[$i]['id']=$row["id_obra"];
      $responce-&gt;rows[$i]['cell']=array($row["id_obra"],$row["nombre"]);
      $i++;
  }
  echo json_encode($responce);
  ?&gt;
  </code></pre>
  
  <p>So... this is all the code, I think that I need a function but I don't know how to do it.
  thanks in advance, and sorry by my english</p>