Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Creating db but I am cocking something up

422422 Developer MVP
edited February 2012 in Vanilla 2.0 - 2.8

I have Category > Sub Category > Models

-- --------------------------------------------------------

--
-- Table structure for table `makes`
--

CREATE TABLE IF NOT EXISTS `makes` (
  `id_cat` int(4) unsigned NOT NULL auto_increment,
  `name` varchar(40) NOT NULL,
  PRIMARY KEY  (`id_cat`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;

--
-- Dumping data for table `makes`
--

INSERT INTO `makes` (`id_cat`, `name`) VALUES
(1, 'Camping Trailers'),
(2, 'Caravans'),
(3, 'Motorhomes and Campers'),
(4, 'Trailers');


-- --------------------------------------------------------

--
-- Table structure for table `types`
--

CREATE TABLE IF NOT EXISTS `types` (
  `id_subcat` int(4) unsigned NOT NULL auto_increment,
  `name` varchar(40) NOT NULL,
  PRIMARY KEY  (`id_subcat`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;

--
-- Dumping data for table `types`
--

INSERT INTO `types` (`id_subcat`, `name`) VALUES
(1, 1, 'Camper Trailers'),
(2, 1, 'Off Road Camper'),
(3, 1, 'Tent Trailer'),
(4, 2, 'Caravan'),
(5, 2, 'Expander'),
(6, 2, 'Fifth Wheeler'),
(7, 2, 'Off Road Van'),
(8, 2, 'On Site Van'),
(9, 2, 'Pop Top'),
(10, 3, 'Bus and Coach'),
(11, 3, 'Campervan'),
(12, 3, 'Motorhome'),
(13, 3, 'Relocatable Homes'),
(14, 3, 'Slide On'),
(15, 4, 'Trailer');

-- --------------------------------------------------------

--
-- Table structure for table `models`
--

CREATE TABLE IF NOT EXISTS `models` (
  `id_models` int(4) unsigned NOT NULL auto_increment,
  `id_subcat` int(4) unsigned NOT NULL,
  `id_cat` int(4) unsigned NOT NULL,
  `name` varchar(40) NOT NULL,
  PRIMARY KEY  (`id_models`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=69 ;

--
-- Dumping data for table `models`
--

INSERT INTO `models` (`id_models`, `id_subcat`, `id_cat`, `name`) VALUES
(1, 1, 1, 'Road Tractor'),
(2, 2, 1, 'Model 16MS'),
(3, 2, 1, 'Model 18 (a8s)'),
(4, 3, 1, 'Dorsoduro 1200'),
(5, 3, 1, 'Dorsoduro Factory'),
(6, 3, 1, 'Dorsoduro SMV750'),
(7, 3, 1, 'ETV1000T Caponord'),
(8, 3, 1, 'Leonardo 150'),
(9, 3, 1, 'Mana 850'),
(10, 3, 1, 'Mana 850 GT ABS'),
(11, 3, 1, 'Mojito 125'),
(12, 3, 1, 'Mojito 150'),
(13, 3, 1, 'Mojito 50'),
(14, 3, 1, 'Pegaso'),
(15, 3, 1, 'Pegaso 650 Trail'),
(16, 3, 1, 'Pegaso 650ie'),
(17, 3, 1, 'Pegaso Factory 650'),
(18, 3, 1, 'Pegaso IE'),
(19, 3, 1, 'RS 125'),
(20, 3, 1, 'RS 125 SBK (Biaggi Limited Edition)'),
(21, 3, 1, 'RST 1000 Futura'),
(22, 3, 1, 'RST 1000T Futura'),
(23, 3, 1, 'RSV 1000R Factory'),
(24, 3, 1, 'RSV 1000R Tuono'),
(25, 3, 1, 'RSV1000 Mille'),
(26, 3, 1, 'RSV1000R'),
(27, 3, 2, 'RSV1000R Mille'),
(28, 3, 2, 'RSV1000R Tuono'),
(29, 3, 2, 'RSV4 Factory'),
(30, 3, 2, 'RSV4 Factory APRC'),
(31, 3, 2, 'RSV4 R'),
(32, 3, 2, 'RSV4 R APRC'),
(33, 3, 3, 'RX50'),
(34, 3, 3, 'RXV 450'),
(35, 3, 3, 'RXV 550'),
(36, 3, 3, 'Scarabeo 100'),
(37, 3, 3, 'Scarabeo 200 ie'),
(38, 3, 3, 'Scarabeo 250 ie'),
(39, 3, 3, 'Scarabeo 300 ie'),
(40, 3, 3, 'Scarabeo 500'),
(41, 3, 3, 'Scarabeo Ditech'),
(42, 3, 3, 'Shiver 750'),
(43, 3, 3, 'Shiver GT ABS'),
(44, 3, 3, 'Shiver Sport 750');

Currently filled with dummy data. Can you see what I am doing wrong.

There was an error rendering this rich post.

Best Answer

  • Options
    x00x00 MVP
    Answer ✓

    quit cussing you sl__________________g!

    grep is your friend.

Answers

Sign In or Register to comment.