This is explain for first answer (by KinjaMistry).
You must be code grammar always! You must write reserved SQL words in uppercase always. You must format your code always. This avoid such problems and errors in future.
SELECT
cart.qty,
products.product_title
FROM cart /* select first from cart beacause here cart is "parent" data */
INNER JOIN products /* join "dependency" data */
ON products.product_id = cart.p_id /* compare as dependency<->parent (like native: you<-above->friend) */