You could also modify the SQL to use the CASE WHEN THEN syntax and give a default image:
SELECT cards.alttext, user_inventory.item_id,
CASE cards.url
WHEN "" THEN "images/blank.gif"
ELSE cards.url
END CASE url
FROM user_inventory, cards
WHERE user_inventory.name = '".mysql_real_escape_string($_GET['user'])."'
AND user_inventory.status = 'collecting' AND user_inventory.item_id = cards.ID
ORDER BY cards.category, cards.deck ASC
You could also use the IF syntax to do it as well.
SELECT cards.alttext, user_inventory.item_id,
IF(cards.url = "", "images/blank.gif", cards.url) AS url
FROM user_inventory, cards
WHERE user_inventory.name = '".mysql_real_escape_string($_GET['user'])."'
AND user_inventory.status = 'collecting' AND user_inventory.item_id = cards.ID
ORDER BY cards.category, cards.deck ASC
Just some other options outside of PHP coding 😉
Oh, and that's not to mention you can set a default value of "blank.gif"..... or whatever default image you want....