"Couldn't execute query" Error in master-detail Grid

Questions"Couldn't execute query" Error in master-detail Grid
Juan Antonio Palacios asked 1 year ago

Hello,

I’m developing a Grid where the master appears in the top, always visible, while each one of the detail grids in one different tab.

Everything was working fine, but when i added the third detail grid, i get a pop-up with the following error. This pop-up opens whenever I select any row on the Master grid:

“Couldn’t execute query. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘) pg_tmp’ at line 1 – SELECT count(*) as c FROM () pg_tmp”

The code of the third grid (the grid that i think is creating this issue) starts like this:

$id= intval($_GET[“rowid”]);
$grid2->select_command = “SELECT DISTINCT t.idA FROM tableR t WHERE t.idB = $id”;

I also tried to change the second line to:
$grid2->select_command = “SELECT DISTINCT t.idA FROM tableR t WHERE t.idB IN ($id)”;

I already tried the SQL query on phpmyadmin and it’s working fine.
Thanks in advance.

1 Answers
Abu Ghufran Staff answered 1 year ago

Please make sure you added ->table property as well along with ->select_command property.

It is required for grid to process some logic internally.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

14 + 19 =

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?