Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> podwójne wyniki
krzyszbi
post 6.06.2006, 15:19:03
Post #1





Grupa: Zarejestrowani
Postów: 251
Pomógł: 13
Dołączył: 15.09.2005

Ostrzeżenie: (0%)
-----


witam
mam takie otozapytanie
  1. SELECT DISTINCT (
  2. p.products_id
  3. ), d.products_description
  4. FROM `products` AS p, `products_to_categories` AS c, `products_description` AS d
  5. WHERE p.products_id = c.products_id = d.products_id AND c.categories_id =4
  6. LIMIT 0, 30

i cos takiego zwraca mi podwójne wyniki ( jak nie ma w zapytaniu d.products_description to jest ok a jak sie doda cos więcej to mam nawet czasami potrójne wyniki)
co tu mam źle sad.gif
struktóry tabel
  1. CREATE TABLE `products_to_categories` (
  2. `products_id` int(11) NOT NULL DEFAULT '0',
  3. `categories_id` int(11) NOT NULL DEFAULT '0',
  4. PRIMARY KEY (`products_id`,`categories_id`)
  5. ) TYPE=MyISAM

  1. CREATE TABLE `products_description` (
  2. `products_id` int(11) NOT NULL AUTO_INCREMENT,
  3. `language_id` int(11) NOT NULL DEFAULT '1',
  4. `products_name` varchar(64) NOT NULL DEFAULT '',
  5. `products_description` text,
  6. `products_url` varchar(255) DEFAULT NULL,
  7. `products_viewed` int(5) DEFAULT '0',
  8. PRIMARY KEY (`products_id`,`language_id`),
  9. KEY `products_name` (`products_name`)
  10. ) TYPE=MyISAM

  1. CREATE TABLE `products` (
  2. `products_id` int(11) NOT NULL AUTO_INCREMENT,
  3. `products_quantity` int(4) NOT NULL DEFAULT '0',
  4. `products_model` varchar(12) DEFAULT NULL,
  5. `products_image` varchar(64) DEFAULT NULL,
  6. `products_price` decimal(15,4) NOT NULL DEFAULT '0.0000',
  7. `products_date_added` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  8. `products_last_modified` datetime DEFAULT NULL,
  9. `products_date_available` datetime DEFAULT NULL,
  10. `products_weight` decimal(5,2) NOT NULL DEFAULT '0.00',
  11. `products_status` tinyint(1) NOT NULL DEFAULT '0',
  12. `products_tax_class_id` int(11) NOT NULL DEFAULT '0',
  13. `manufacturers_id` int(11) DEFAULT NULL,
  14. `products_ordered` int(11) NOT NULL DEFAULT '0',
  15. PRIMARY KEY (`products_id`),
  16. KEY `idx_products_date_added` (`products_date_added`)
  17. ) TYPE=MyISAM

tabele takie są zawarte w osComerce - ( darmowy sklep internetowy który przerabiam ) i nie zabardzo mi to wychodzi jak widac od strony MySql-a z php sobie radze biggrin.gif


--------------------
Everything should be made as simple as possible, but not simpler. - A.Eainstein
Go to the top of the page
+Quote Post

Posty w temacie
- krzyszbi   podwójne wyniki   6.06.2006, 15:19:03


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 20.07.2025 - 09:25