Re: need help creating a mysql 5.0.95 query
Posted by:
jae ahn
Date: March 24, 2012 10:39AM
yes, the products_to_categories doesn't have product name for me to do an easy search and narrow those down. i need to search the product name under products_description, then find the product_id associated with those product_names, and then find the matching product_id in the other table products_to_categories, and then assign them a new categories_id.
here is the show create table information. once again, sorry for the format. i'm just copying and pasting
Table Create Table
products_description CREATE TABLE `products_description` (
`products_id` int(11) NOT NULL auto_increment,
`language_id` int(11) NOT NULL default '1',
`products_name` varchar(64) NOT NULL default '',
`products_description` text,
`products_url` varchar(255) default NULL,
`products_viewed` int(5) default '0',
`del_yn` char(1) default NULL,
PRIMARY KEY (`products_id`,`language_id`),
KEY `products_name` (`products_name`),
FULLTEXT KEY `products_description` (`products_description`)
) ENGINE=MyISAM AUTO_INCREMENT=38789 DEFAULT CHARSET=latin1
Table Create Table
products_to_categories CREATE TABLE `products_to_categories` (
`products_id` int(11) NOT NULL default '0',
`categories_id` varchar(30) NOT NULL default '',
`idx` int(11) default NULL,
PRIMARY KEY (`products_id`,`categories_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
Edited 1 time(s). Last edit at 03/24/2012 10:42AM by jae ahn.