Yeah, kinda figured that wayne
I'm sure there's a way to pull them out without DISTINCT...
What I'm attempting is to pull the store_name, product_name, and upload date out of a table called "inventory". In addition, pull out the thumbnail path from a table called "uploads". This script has been chopped up a lot, so a while ago I had a WHERE clause to pull only the info out WHERE store_name is the one owned by the user.
Code: Select all
CREATE TABLE `inventory` (
`id` int(10) NOT NULL auto_increment,
`product_id` varchar(100) NOT NULL default '',
`product_name` varchar(30) NOT NULL default '',
`uploadDate` date NOT NULL default '0000-00-00',
`store_name` varchar(30) NOT NULL default '',
`store_owner` varchar(30) NOT NULL default '',
`store_email` varchar(50) NOT NULL default '',
`search_hits` int(10) NOT NULL default '0',
`hits` int(10) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `product_name` (`product_name`,`store_name`)
)
Code: Select all
CREATE TABLE `uploads` (
`id` int(10) NOT NULL auto_increment,
`username` varchar(30) NOT NULL default '',
`lastUploadDate` date NOT NULL default '0000-00-00',
`product_id` varchar(100) NOT NULL default '',
`product_name` varchar(20) NOT NULL default '',
`image_path` varchar(50) default 'members/nophoto_thumb.jpg',
`thumb_path` varchar(50) default 'members/nophoto_thumb.jpg',
PRIMARY KEY (`id`)
)