did integration in joomla, i can see my tables, fine, but when i want to only show some colums, i get an error
$col = array();
$col[“title”] = “Id”; // caption of column, can use HTML tags too
$col[“name”] = “id”; // grid column name, same as db field or alias from sql
$col[“width”] = “20”; // width on grid
$col[“editable”] = true;
$cols[] = $col;
$col = array();
$col[“title”] = “Name”; // caption of column, can use HTML tags too
$col[“name”] = “name”; // grid column name, same as db field or alias from sql
$col[“width”] = “40”; // width on grid
$col[“editable”] = true;
$cols[] = $col;
$col = array();
$col[“title”] = “Username”; // caption of column, can use HTML tags too
$col[“name”] = “username”; // grid column name, same as db field or alias from sql
$col[“width”] = “60”; // width on grid
$col[“editable”] = true;
$cols[] = $col;
// pass the cooked columns to grid
$grid->set_columns($cols);
Couldn’t execute query. You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘) pg_tmp’ at line 1 – SELECT count(*) as c FROM () pg_tmp
Error shows table name is missing in your grid config: SELECT count(*) as c FROM (…………………)
Along with select_command, you also need to set $grid->table = “yourtablename”;