How to show part of a webpage if a recordset condition is true

By Chris on January 13, 2011 in php

With a neat bit of php of course! Using the code below you can reveal a section of your page when your recordset’s (yourrecordset) table row (tablerow) is equal to a certain result. I used this to reveal a ‘New Product’ image over the top of a product if the content of the recordset result matched what was‘yourconditionhere’.

<?php if ($row_yourrecordset[‘tablerow‘]==”yourconditionhere“){ ?>
Hello World!
<?php } ?>


Leave a reply

Leave a Reply

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