![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 74 Pomógł: 3 Dołączył: 30.03.2014 Ostrzeżenie: (0%) ![]() ![]() |
Witam
Może przejdę do porblemu. baza: -products -categories model -category
-product
controller category
błąd: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'lavarel.category_product' doesn't exist (SQL: select `products`.*, `category_product`.`category_id` as `pivot_category_id`, `category_product`.`product_id` as `pivot_product_id` from `products` inner join `category_product` on `products`.`id` = `category_product`.`product_id` where `category_product`.`category_id` = 1) Mógłby ktoś nakierować mnie na rozwiązanie tego problemu? |
|
|
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 8 068 Pomógł: 1414 Dołączył: 26.10.2005 Ostrzeżenie: (0%) ![]() ![]() |
U Ciebie jest potrzebna jeszcze jedna tabela bo masz relację ManyToMany
3 tabela to `category_product` z polami `category_id`, `product_id` Chyba że masz 1 prod 1 kategroria to wtedy w Product zostawiasz, a w Category dajes hasMany |
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 74 Pomógł: 3 Dołączył: 30.03.2014 Ostrzeżenie: (0%) ![]() ![]() |
(IMG:style_emoticons/default/businesssmiley.png) dzięki... nie spodziewałem się że to takie proste rozwiązanie, będę musiał jeszcze raz poczytać i zrozumieć co kiedy stosować..
<like> i pozdrawiam (IMG:style_emoticons/default/smile.gif) |
|
|
![]() ![]() |
![]() |
Aktualny czas: 20.09.2025 - 14:40 |