How to hide an area of HTML if a recordset result is empty

By Chris on September 18, 2010 in php

A simple bit of code like the one below is all you need. In this case the recordset name is ‘rs_page’ and the table column that is being tested is ‘image’. If there is nothing returned from the query then the area ‘HTML here’ is hidden.

<?php if (!empty($row_rs_page[‘image’])) {?>

HTML here

<?php }?>


Leave a reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.