Skip links

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

September 18, 2010

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 }?>

chris-parker
This website uses cookies to improve your web experience.
chris-parker

Send me a message.

Happy to answer any question you may have.

chris@chrisparkerdesign.co.uk

07813 311253

    Your Name (required)

    Your Email (required)

    Subject

    Your Message

    CHRIS PARKER DESIGN

    chris@chrisparkerdesign.co.uk

    07813 311253