column select problems

Questionscolumn select problems
maarten blokdijk asked 4 years ago

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

 

1 Answers
Abu Ghufran Staff answered 4 years ago

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

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

5 + 20 =

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?