I have some custom fields in my product info templates in my store. I want to create some switches so that if there is no data in the sql, the code disappears on the catalog side.
This is what I have. It correctly comments out the code if there is no data in the sql BUT it is not displaying the sql data if there is data.
This is the code it is not displaying:Code:<?php $product_info = $db->Execute("select jewel_ring_weight from " . TABLE_PRODUCTS . " where products_id = '" . (int)zen_db_prepare_input($_GET['products_id']) . "'"); if ($product_info->fields['jewel_ring_weight'] > 0) { echo '<br />'; echo '<tr class="prodSpecItem2 prodS"><td class="prodSpec2">Weight - Band (g):</td><td>' . ($product_info->fields['jewel_band_weight'] ) . '</td></tr>'; } ?>
<td>' . ($product_info->fields['jewel_band_weight'] ) . '</td>
Is this the correct way to extract the data from the database? If not what am I doing wrong?
Thanks for helping a novice.


Doh! Now that is just embarrassing! Geez . . . Thanks Ajeh for lending your expertise. It appears to work now.
but how do I do a switch if sql data is text and not numeric? The > 0 doesn't seem to have any effect.

