Random SQL non Grid CRUD operations

QuestionsRandom SQL non Grid CRUD operations
C3media asked 10 years ago

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

4 Answers
Abu Ghufran answered 10 years ago

I dont understand your question. A little more explanation with some steps / code would help.

C3media answered 10 years ago

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?

Abu Ghufran answered 10 years ago

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);

C3media answered 10 years ago

Thanks Abu,

Look fine!

Your Answer

3 + 1 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?