SELECT SQL_CALC_FOUND_ROWS available.*
FROM available
LEFT JOIN cart
ON available.id = cart.item_id
WHERE cart.item_id IS NULL
AND `fname` LIKE '%de%'
ORDER BY `id` asc
SELECT SQL_CALC_FOUND_ROWS available.*
FROM available
LEFT JOIN cart ON available.id = cart.item_id
WHERE `fname` LIKE '%de%' AND cart.item_id IS NULL
ORDER BY `id` asc