Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Bled w zapytaniu mysl z inner join, wywala przy opcjach kategorii
daniofantasy
post
Post #1





Grupa: Zarejestrowani
Postów: 30
Pomógł: 1
Dołączył: 14.06.2007
Skąd: Chesterfield UK

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


mam takie zapytanko co leci do bazy i wybiera wszystkie rekordy (po id), ktore spelniaja kryteria zaawansowanych opcji produktu i gdzies tam sie zagniezdzil blad - ktos pomoze?

zapytanko SQL:

  1. SELECT
  2. SearchFilter.ProductID AS id
  3. FROM
  4. SearchFilter
  5. INNER JOIN
  6. products_to_features products_to_features0
  7. ON
  8. SearchFilter.ProductID = products_to_features0.ProductsId
  9. WHERE
  10. (
  11. (
  12. (
  13. products_to_features0.FeaturedId = "2"
  14. OR
  15. products_to_features0.FeaturedId = "394"
  16. OR
  17. products_to_features0.FeaturedId = "7898"
  18. )
  19. AND
  20. (
  21. products_to_features0.ValueId = "943"
  22. OR
  23. products_to_features0.ValueId = "1588"
  24. OR
  25. products_to_features0.ValueId = "2057"
  26. OR
  27. products_to_features0.ValueId = "2924"
  28. OR
  29. products_to_features0.ValueId = "3288"
  30. OR
  31. products_to_features0.ValueId = "3298"
  32. OR
  33. products_to_features0.ValueId = "3304"
  34. OR
  35. products_to_features0.ValueId = "42458"
  36. OR
  37. products_to_features0.ValueId = "202643"
  38. OR
  39. products_to_features0.ValueId = "13491"
  40. OR
  41. products_to_features0.ValueId = "252913"
  42. )
  43. )
  44. )
  45.  
  46. INNER JOIN
  47. products_to_features products_to_features1
  48. ON
  49. SearchFilter.ProductID = products_to_features1.ProductsId
  50. WHERE
  51. (
  52. (
  53. (
  54. products_to_features1.FeaturedId = "1"
  55. )
  56. AND
  57. (
  58. products_to_features1.ValueId = "1027"
  59. OR
  60. products_to_features1.ValueId = "1030"
  61. OR
  62. products_to_features1.ValueId = "1031"
  63. )
  64. )
  65. )
  66. AND
  67. (
  68. (
  69. SearchFilter.price>=0
  70. AND
  71. SearchFilter.price<=299.99
  72. )
  73. )


Bkled z mysql:

  1. #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inner join products_to_features products_to_features1 on SearchFilter.Produ' at line 46


z gory dzieki
Go to the top of the page
+Quote Post

Posty w temacie


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 Aktualny czas: 22.08.2025 - 04:57