1 tabela "produkty"
CODE
CREATE TABLE `produkty` (
`id` int(11) NOT NULL auto_increment,
`kategoria` int(11) NOT NULL,
`nazwa` varchar(60) NOT NULL,
`cena` float NOT NULL,
`opis` text NOT NULL,
`img` text NOT NULL,
`kolory` text NOT NULL,
KEY `id` (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=32 DEFAULT CHARSET=utf8 AUTO_INCREMENT=32 ;
`id` int(11) NOT NULL auto_increment,
`kategoria` int(11) NOT NULL,
`nazwa` varchar(60) NOT NULL,
`cena` float NOT NULL,
`opis` text NOT NULL,
`img` text NOT NULL,
`kolory` text NOT NULL,
KEY `id` (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=32 DEFAULT CHARSET=utf8 AUTO_INCREMENT=32 ;
2 tabela "kolory"
CODE
CREATE TABLE `kolory` (
`id` int(11) NOT NULL auto_increment,
`nazwa_koloru` text NOT NULL,
`plik` text NOT NULL,
KEY `id` (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
`id` int(11) NOT NULL auto_increment,
`nazwa_koloru` text NOT NULL,
`plik` text NOT NULL,
KEY `id` (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
Chciałem żeby wyglądało to tak, że wyświetlam produkt o konkretnym id i do niego dodaje kolory z tabeli "kolory". W tabeli produkty `kolory` mam wpisane po przecinku id, które maja być pobrane z tabeli kolory `id`. Nie wiem zbytnio jak skonstruować zapytanie pobierające te dane.
Pozdrawiam.