Display echo if there are no rows on page

Hi, I am making a virtual shop where you can buy items in an RPG, and I was wondering how you can display an if statement with a message saying that all items are sold out if there are no more rows for items left in on the page. Thanks!