Hello,
i bought yesterday the full version of script and i cannot understand how use custom query.
This is my code:
http://pastebin.com/qZjrQ6Y8
In this case how show in column grid the field CodUtenzaDispositivo of ht_ass_h_garbage table joined with the ht_ass_garbage?
I tried:
$col = array();
$col["title"] = "ht_ass_aer"; // caption of column, can use HTML tags too
$col["name"] = "ht_ass_h_aer.CodUtenzaDispositivo"; // grid column name, same as db field or alias from sql
$col["search"] = false; // this column is not searchable
$col["width"] = "25"; // width on grid
$cols[] = $col;
(see pastebin code) but dont work.
Can you please, help me?
Thanks.
Massimo
… sorry,
In this case how show in column grid the field CodUtenzaDispositivo of ht_ass_h_aer table joined with the ht_ass_garbage?
If you query is correct and work on database (test with phpmyadmin), then you need to set:
$col["name"] = "CodUtenzaDispositivo"; // (without table name)
…
$col = array();
$col["title"] = "ht_ass_aer"; // caption of column, can use HTML tags too
$col["name"] = "CodUtenzaDispositivo"; // grid column name, same as db field or alias from sql
$col["search"] = false; // this column is not searchable
$col["width"] = "25"; // width on grid
Yes, the query work correctly and the the field CodUtenzaDispositivo is ambiguus because is present in two tables (ht_ass_garbage and ht_ass_h_aer).
For displaying in grid, you need to set just:
$col["name"] = "CodUtenzaDispositivo";
ok, It will be required in searching.
You need to set:
$col["dbname"] = "ht_ass_garbage.CodUtenzaDispositivo";
Ok, another step please.
I see custom query work with primary key named "id" but in my database the primary key is named "Seriale" (and i cannot modify). How can i set the correct pk ?