Autocomplete

QuestionsAutocomplete
Gustavo Lazaro asked 2 years ago

Hello. In the sql on formatoptions, can I use the where clause?

$col["formatter"] = "autocomplete"; // autocomplete
$col["formatoptions"] = array("sql"=>"SELECT codProfesional AS k, nombre AS v FROM gen_profesional ORDER BY nombre", "search_on"=>"matricula", "update_field"=>"codProfesional");

1 Answers
Abu Ghufran answered 2 years ago

Yes, you can use WHERE clause in this sql.
e.g.
$col["formatoptions"] = array( "sql"=>"SELECT *, name as v FROM clients WHERE gender='female' ORDER BY name desc",
"search_on"=>"concat(name,'-',client_id)",…………..);

Your Answer

18 + 3 =

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 / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!