Hello, I am new to PHP and am trying to generate tabs on the fly based on information gathered in my database. I am using Spry Tabbed Panels as the content holder.
So far I have been able to eliminate a tab based on the null value but I am unable make the content section of the tabs follow suit. I have tried to add a if statement that wraps around the div tag creating the content part of the tabs but I continue to get an error when it is querying the database again. I figure it has something to do with a nested php command but I have tried everything I can figure and all I get is a blank page or a blank tab.
I would greatly appreciate any help you could give me as this is the last piece to my company’s website.
The code below eliminate the parent tab but then leaves the remaining tabs empty.
- Brochure <?php if ($row_rsDetails['Video'] !== Null) { echo '
- Videos '; } ?> <?php if ($row_rsDetails['Xtra1'] !== Null) { echo '
- Additional Images '; } ?>
<div class="TabbedPanelsContentGroup">
<div class="TabbedPanelsContent">
<table width="400">
<tr>
<td align="center"><a href="#" target="blank"><img src="images/pdfs/<?php echo $row_rsDetails['Image']; ?>" alt="<?php echo $row_rsDetails['ModelName']; ?>" border="1" /></a></td>
</tr>
</table>
</div>
<div class="TabbedPanelsContent">
<table width="400">
<tr>
<td><?php echo $row_rsDetails['Video']; ?></td>
</tr>
</table>
</div>
<div class="TabbedPanelsContent">
<table width="400">
<tr>
<td><img src="<?php echo $row_rsDetails['Xtra1']; ?>" vspace="10" align="left" /></td>
<td><img src="<?php echo $row_rsDetails['Xtra2']; ?>" vspace="10" align="right" /></td>
</tr>
<tr>
<td><img src="<?php echo $row_rsDetails['Xtra3']; ?>" vspace="10" align="left" /></td>
<td><img src="<?php echo $row_rsDetails['Xtra4']; ?>" vspace="10" align="right" /></td>
</tr>
</table>
</div>
</div>
This shows where I have tried to fix the problem in the div tag.
<?php
if ($rsDetails[‘Video’] !== Null) {
echo ’
<echo $row_rsDetails[‘Video’];> | (THIS IS THE LINE THAT HAS AN ERROR)
}
?>