Skip to main content
June 5, 2006
Answered

help with php detail page

  • June 5, 2006
  • 1 reply
  • 304 views
Hello
I was hoping someone would help me figure out a problem.
Php
Mysql
I have configure a detail page which is working correctly. All fields are populating properly. The problem is that if a field is null, i want to hide the text before it.
Example
<td valign="top" align="left">Unit View: <?php echo $row_rscdetail['unit_view']; ?></td>

if there is not a value in $row_rscdetail['unit_view'] then I don't want Unit View: to be displayed.

Is there an easy way to do this.
Thanks in advance.
Tim
This topic has been closed for replies.
Correct answer Newsgroup_User
if ($row_rscdetail['unit_view'])) {
echo 'Unit View: ' .$row_rscdetail['uniview'];
}

i think will do it. or set your field to a variable, and check fro that.

> <td valign="top" align="left">Unit View: <?php echo
> $row_rscdetail['unit_view']; ?></td>
>
> if there is not a value in $row_rscdetail['unit_view'] then I don't
> want
> Unit View: to be displayed.
>
> Is there an easy way to do this.
> Thanks in advance.
> Tim
>
>


1 reply

Newsgroup_UserCorrect answer
Inspiring
June 5, 2006
if ($row_rscdetail['unit_view'])) {
echo 'Unit View: ' .$row_rscdetail['uniview'];
}

i think will do it. or set your field to a variable, and check fro that.

> <td valign="top" align="left">Unit View: <?php echo
> $row_rscdetail['unit_view']; ?></td>
>
> if there is not a value in $row_rscdetail['unit_view'] then I don't
> want
> Unit View: to be displayed.
>
> Is there an easy way to do this.
> Thanks in advance.
> Tim
>
>


June 5, 2006
Crash
That Did it

Thanks for saving me a lot more research time. I was having trouble finding the exact method.
Tim