pengu, the first query finds matching rows in both tables and counts those, whereas the second query (without the join) counts ALL rows fitting the "where" condition, even if they don't match a row in the other table.
So it will work only if there's a 1 to 1 correspondence between ids in each table, which is unlikely when one table is a basket and the other is a product list.
I think what the OP actually wanted was this:
SELECT COUNT( b.id ), SUM(p.search_price)
FROM basket b
INNER JOIN products b ON b.id = p.id
WHERE p.for_sale = "yes" AND b.ip_address = "'.$_SERVER["REMOTE_ADDR"].'" GROUP BY b.ip_address
That gives the total product count and the total price. It doesn't get the unique item count, but I'm not clear on exactly what was wanted.