Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column not found 'items.carts_id' #41

Open
Mathias88 opened this issue Mar 19, 2016 · 5 comments
Open

Column not found 'items.carts_id' #41

Mathias88 opened this issue Mar 19, 2016 · 5 comments

Comments

@Mathias88
Copy link

Hi,

I have this problem when I use {!! $cart->count !!}. Why?

This is the error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'items.carts_id' in 'on clause' (SQL: select sum(items.quantity) as itemCount, sum(items.price * items.quantity) as totalPrice, sum(items.tax * items.quantity) as totalTax, sum(items.shipping * items.quantity) as totalShipping from carts inner join items on items.carts_id = carts.id where carts.id = 8 limit 1) (View: /var/www/theshop/modules/Shopping/Resources/views/cart/cart.blade.php)

Thanks!

@amostajo
Copy link
Collaborator

carts_id looks odd.

@Mathias88
Copy link
Author

In the config, I change the name of table. By default, the name is "cart", but I change by "carts"

@amostajo
Copy link
Collaborator

Did you changed the name of column in table items as well?
On Mar 24, 2016 5:38 PM, "Mathias88" [email protected] wrote:

In the config, I change the name of table. By default, the name is "cart",
but I change by "carts"


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#41 (comment)

@Mathias88
Copy link
Author

In the table items, the name of column is cart_id.

@amsgames
Copy link
Owner

Your query for some reason is looking for carts_id instead of cart_id.
Weird
On Mar 25, 2016 11:43 AM, "Mathias88" [email protected] wrote:

In the table items, the name of column is cart_id.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#41 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants