raw888
asked on
Hide/ show a recordset row item
Making a page to display a resume. If a category or row is empty or null ..do not want the the title to appear. using dreamweaver's detail generated recordset. This is one example: nothing displays , regardles if there is data or not. What is wrong? or a suggestion of a better way.
Thanks
Thanks
<!--travel-->
<?php if ($totalRows_DetailRS1['travel'] > 0) { ?>
<div class="sub_ttl1">Travel?</div>
<p><?php echo $row_DetailRS1['travel']; ?></p>
<?php } ?>
ASKER
will try...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
<?php error_reporting(E_ALL) ?>
<?php var_dump($totalRows_DetailRS1);?>
<?php var_dump($row_DetailRS1);?>
error message:
Notice: Undefined variable: totalRows_DetailRS1 in /home/resumeva/public_html
NULL
Notice: Undefined variable: row_DetailRS1 in /home/resumeva/public_html
ASKER
that was the trick...thanks!
Notice: Undefined variableAs soon as you understand what that means, you will be able to move to the next level! Until then, well, not so much.
Best of luck and thanks for using EE, ~Ray
var_dump($totalRows_Detail
var_dump($row_DetailRS1);
Once you can see the data, you will be able to know what path in the code will be dictated by the if() statements.
Be certain to add error_reporting(E_ALL) to the top of all your scripts in order to avoid accidentally relying on an undefined variable.
If you're relatively new to PHP, you might find some value in using the learning resources shown in this article. DreamWeaver is not a good way to learn PHP, but there are some very good ways shown in the article.
https://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_11769-And-by-the-way-I-am-new-to-PHP.html