Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

help with php detail page

Guest
Jun 05, 2006 Jun 05, 2006
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
TOPICS
Server side applications
305
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jun 05, 2006 Jun 05, 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
>
>


Translate
LEGEND ,
Jun 05, 2006 Jun 05, 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
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 05, 2006 Jun 05, 2006
Crash
That Did it

Thanks for saving me a lot more research time. I was having trouble finding the exact method.
Tim
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 05, 2006 Jun 05, 2006
LATEST
glad to be of assist.

have a good week


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines