[ic] Accessing MySQL tables other than the default 'products' table using the search tag

Sam Hui shui@lunamedium.com
Fri, 9 Feb 2001 19:05:58 -0800


Hi,

We have setup a simple catalog similar to the tutorial, but would like to
setup additional tables under MySQL.  The problem we are having is that
whenever we do a search on a table other than default products table using
the loop search:

[loop search="st=db/ra=yes/fi=table_X"]
    column_A: [loop-field <table column_A>]
[/loop]

It would seem to return blank or null.  Strangely though, if column_A also
exists in the products table, the value returned would be from the products
table not table_X.  Doing the same query using query tag:

[query sql="select column_A from table_X" list=1]
    column_A: [sql-param column_A]<br>
[/query]

works flawlessly in getting the correct column values.


Here is our table/db setup in our catalog.cfg:

Database        products        products.sql    dbi:mysql:interchange
Database        products        USER    <mysql user>
Database        products        PASS    <mysql password>

Database        product_detail        product_detail.sql
dbi:mysql:interchange
Database        product_detail        USER    <mysql user>
Database        product_detail        PASS    <mysql password>

Another quick question, is this the only to declare tables (from the same
database) for Interchange?  Hoping to see if there is a better way to do
this.

Using Interchange 4.6.1
Any help would be much appreciated.

-Sam