When using this :
$g->select_command = “SELECT KAWRFCID, Node, KAWShort, KAWUitvoerdatum, Metingop, Metingnodig, LOCATE(KAWShort,Oldrfcinfo) as foundkaw,Oldrfcinfo,Element_Adres,Component, NewRFC FROM XXL_KAWRFC_Lijst”;
$g->table = “XXL_KAWRFC_Lijst”;
in combination with this field :
$col = array();
$col[“title”] = “KAWfound”;
$col[“dbname”] = “LOCATE(KAWShort,Oldrfcinfo)”;
$col[“name”] = “foundkaw”;
$col[“width”] = “3”;
$col[“search”] = true;
$col[“align”] = “right”;
$cols[] = $col;
Autofilter works perfectly but when I use the templates with this code it throws an error :
// Define predefined search templates
$grid[“search_options”][“tmplNames”] = array(“Nodige meting”);
$grid[“search_options”][“tmplFilters”] = array(
array(
“groupOp” => “AND”,
“rules” => array (
array(“field”=>”foundkaw”, “op”=>”cn”, “data”=>”0”)
)
)
);
Getting error : Couldn’t execute query. Unknown column ‘LOCATE(KAWShort,Oldrfcinfo)’ in ‘where clause’ – SELECT count(*) as c FROM (SELECT KAWRFCID, Node, KAWShort, KAWUitvoerdatum,Metingop,Metingnodig,LOCATE(KAWShort,Oldrfcinfo) as foundkaw,Oldrfcinfo,Element_Adres,Component, NewRFC FROM XXL_KAWRFC_Lijst WHERE 1=1 AND `LOCATE(KAWShort,Oldrfcinfo)` LIKE ‘%0%’) pg_tmp
When I remove the ` (around the LOCATE(KAWShort,Oldrfcinfo)) from the Query it works.
What is the solution to this problem?
Thanks,
best regards
This may need a fix. Will be updating you back after some more testing.
Looks like you are using older version as i am unable to generate this issue on latest.
Emailing you latest, please check after update.