Hello to you all,
Using 5.72
sorry to bother you with this 'trivial' problem.
I am trying to filter a lookup list.
The filter is on a field named actif in the equipe table.
the field actif is a varchar of length 3
In phpMyAdmin, the field actif has been set to index
PROBLEM : On click over the field in detail view, I get the spinning "gizmo" which runs forever without displaying the list (7 items in the table and 6 should be displayed with the filter)
The SQL is:
-----------------
SELECT `equipe`.`id`, IF(CHAR_LENGTH(`equipe`.`nom`) || CHAR_LENGTH(`equipe`.`id`), CONCAT_WS('', `equipe`.`nom`, ' / ', `equipe`.`id`), '') WHERE `equipe`.`actif` != 'Non' FROM `equipe` ORDER BY 2
------------------
I tried with:
-------------------------
SELECT `equipe`.`id`, IF(CHAR_LENGTH(`equipe`.`nom`) || CHAR_LENGTH(`equipe`.`id`), CONCAT_WS('', `equipe`.`nom`, ' / ', `equipe`.`id`), '') WHERE `equipe`.`actif` = 'Oui' FROM `equipe` ORDER BY 2
------------------
What I am doing wrong here?
Regards
Lookup Filter
Re: Lookup Filter
Hi,
can you run the query in phpMyAdmin and see if the query delivers the correct results?
can you run the query in phpMyAdmin and see if the query delivers the correct results?
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Lookup Filter
Sorry, my stupid mistake.
I put the WHERE statement before the FROM statement.
The following works great
-------------------------
SELECT `equipe`.`id`, IF(CHAR_LENGTH(`equipe`.`nom`) || CHAR_LENGTH(`equipe`.`id`), CONCAT_WS('', `equipe`.`nom`, ' / ', `equipe`.`id`), '') FROM `equipe` WHERE `equipe`.`actif` = 'Oui' ORDER BY 2
------------------
I put the WHERE statement before the FROM statement.
The following works great
-------------------------
SELECT `equipe`.`id`, IF(CHAR_LENGTH(`equipe`.`nom`) || CHAR_LENGTH(`equipe`.`id`), CONCAT_WS('', `equipe`.`nom`, ' / ', `equipe`.`id`), '') FROM `equipe` WHERE `equipe`.`actif` = 'Oui' ORDER BY 2
------------------