I want to hide a <table> or <div> based on a value in a MySQL database row but can't for the life of me figure it out after 3 days of trying hundreds of different combinations:
A value of '1' is assigned to a database listing as standard and inserted into the table column named 'type'.
If the user of the listing wants to make it 'featured' a value of '2' is assigned to the 'type'.
The table looks like this (simplified):
<table><tr><td>
<script type="text/javascript">
featuredcontentglider script from dynamic drive
</script>
<div id="featured" class="glidecontentwrapper"></div>
</td></tr></table>
I would like to hide the whole table (possibly show another table instead) if the value in the database 'type' column is NOT '2'.
I've tried all sorts of different combinations to only show the table if the value in 'type' column was = to 2 but can't get it to work.
Tried enclosing table in <div> tags
Tried php if statements/ if else / echo etc
Just can't seem to get it to work!
Any help or a point in the right direction would be very much appreciated.