Clear as the Mississippi River. Right? What I want to show on the page is:
TITLE, PRICE, DESCRIPTION,
IMAGE (if there is an image entry for this specific title),
More Details LINK (if there is a SUMMARY entry).
What I'm trying to solve is the "if":
If there is an image, show it; else, do nothing.
If there is a summary, create the link; else, do nothing.
One solution would be a Perl Module to process the basic SELECT * query; process the data; then create the html page. I'm looking for an easier way via mySQL.
Ashford
--------------------------------------------------------
TABLES AND EXAMPLES OF DATA
I took out some of the irrelevant columns, NOT NULL, and DEFAULT info to make for an easier read.
CREATE TABLE inventory (
code int(11) unsigned ,
title varchar(100) ,
authorLast varchar(40) ,
description varchar(255) ,
summary varchar(255) ,
link varchar(255) ,
image varchar(255) ,
stock mediumint(8) ,
price decimal(7,2) ,
PRIMARY KEY (code),
) TYPE=ISAM PACK_KEYS=1;
--------------------------------
Examples of column data:
`description` = HBDJ, 185 pp, pub. 2002
`summary` = <!--#include virtual="/cgi-bin/catalog/include/book_1.inc" -->
'link' = a href=path/to/template.html
'image' = !MY
---------------------------------------------
CREATE TABLE templates (
name varchar(50) ,
file_html varchar(20) ,
query text ,
title varchar(40) ,
sortBy varchar(255) ,
PRIMARY KEY (name)
) TYPE=ISAM PACK_KEYS=1;
---------------------------------------------
Examples of column data:
INSERT INTO templates VALUES (
'sale_auth_all',
'shop.html',
'SELECT * FROM inventory WHERE sale_status = '1',
'Great Deals: authors',
'<!--#include virtual="/cgi-bin/catalog/include/sort_sale.inc" -->'
);
---------------------------------------------