[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] I would need some advice for the UI
On Thu, 2002-06-20 at 04:24, René Hertell wrote:
> Hi all,
>
> I'm building a table from a lots of references to other tables. This part is
> easy to implement with building the references with the table-lookup
> feature. Everything works an looks fine on the edit page, but the list-page
> is my problem. I can't figure out how to get the skus (foreign keys) to be
> displayed as something else (eg. it would pull out the second column from
> the reference table)
>
Here is an example we have that may address your problem.
mysql> EXPLAIN brands;
+-------------+-----------------------+------+-----+
| Field | Type | Null | Key |
+-------------+-----------------------+------+-----+
| brandid | mediumint(8) unsigned | | PRI |
| brand | varchar(50) | | UNI |
| description | text | | |
+-------------+-----------------------+------+-----+
mysql> EXPLAIN items;
+---------------+-----------------------+------+-----+
| Field | Type | Null | Key |
+---------------+-----------------------+------+-----+
| itemid | mediumint(8) unsigned | | PRI |
| title | varchar(64) | | MUL |
| catid | smallint(5) unsigned | | MUL |
| description | longtext | | MUL |
| brandid | mediumint(8) unsigned | | MUL |
+---------------+-----------------------+------+-----+
catalog.cfg:
ProductFiles items
Then on a flypage:
[data table=brands col=brand key='[item-field brandid]']
Or use a query on any page:
[query
list=1
sql=|
SELECT brand
FROM items
LEFT JOIN
brands USING(brandid)
WHERE
itemid='[either][cgi itemid][or][value itemid][or]<some itemid you
provide>[/either]'
|
][sql-param brand][/query]
--
Bill Carr
Worldwide Impact
bill@worldwideimpact.com
413-253-6700