This topic is locked

Search on fields with Lookup Wizard: it searches IDs not Text Names

9/13/2007 7:57:40 AM
PHPRunner General questions
S
seriously author

Hi.
Using 4.0 (build 265), I try to make a list page of 'books' table:
book_id - name - year - author_id
I created "Author" field with Lookup Wizard, and I'm able to list it with their full name. But if I try to search an author with the tool of the top of the listing page, it shows only IDs.
However, if I use "advanced search", I get the list of authors' name, not IDs. Is it possible that search option of listing pages works with "Lookup Wizard" and not with IDs?
Thank you very much.

Alexey admin 9/13/2007

Hi,
I recommend you to use joined query in PHPRunner to be able to search on authors's name.

Modify your SQL query this way:

select

book_id,

books.name,

books.author_id,

authors.name as author_name

from books

left join authors on authors.author_id = books.author_id


then choose to use author_name instead of author_id for searching on Choose fields tab in PHPRunner.