This topic is locked

Foreign key problem/bug

3/12/2008 2:24:24 PM
PHPRunner General questions
F
Fawaz author

Table Category: id, name

Table Product: id, category_id
When I list all products, I chose to display category_name, instead of category_id.

However search functions don't work on category_name.

Is this a bug?

If not, how can I sort it?
Thanks.

Fawaz

A
alang 3/12/2008

This is a little bit of a pain. The way around it is to customise the SQL so that you join to category table (include name field) and include that in your search fields. It does have an impact in other areas because you need to unset the joined field before save to database etc.