Error performing query
SELECT *, i.status AS orderstatus FROM orders AS o
INNER JOIN cart AS c ON o.order_id = c.order_id
INNER JOIN invoice AS i ON i.order_id = c.order_id
INNER JOIN users AS u ON c.user_id = u.user_id
WHERE c.user_id = AND c.type = 'order'
GROUP BY o.order_id
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 'AND c.type = 'order'
GROUP BY o.order_id' at line 5