Hi,
I´m trying to load custom SQL from table, it´s can be stay outside Grid; so parameters will load in action custom form.
Thanks
I dont understand your question. A little more explanation with some steps / code would help.
Fine
Abu i have this code…
$sql="SELECT * from convivencia ORDER BY detalle ASC";
$result = $incidencias->query($sql); //usamos la conexion para dar un resultado a la variable
if ($result->num_rows > 0) //si la variable tiene al menos 1 fila entonces seguimos con el codigo
{
$combobit="";
while ($row = $result->fetch_array(MYSQLI_ASSOC))
{
$combobit .=" <option value='".$nombre." ".$row['detalle']."'>".$row['detalle']."</option>"; //concatenamos el los options para luego ser insertado en el HTML
}
}
else
{
echo "No results";
}
¿It´s possible to connect $sql Var to Database GRID?
Yes, you can pass this $sql to
$g->select_command = $sql; (where $g is jqgrid object).
Limitation would be, you need to remove he 'ORDER BY detalle ASC' part and set this order by setting in grid options.
$grid["sortname"] = 'detalle';
$grid["sortorder"] = "asc";
$g->set_options($grid);