Supress Blank Rows - PHP

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Supress Blank Rows - PHP

    I am adding lines of information to committee members drawn from MySQL
    database. Not all members have daytime or mobile phone numbers or email
    addresses so I dont want blank rows to appear where that is the case. I have
    written the following if statements, the idea being that if the rows are not
    NULL the data will appear and a break will be applied. However, when I add the
    <br> or <br /> tag I get parsing errors, no matter where I write the tags. I
    am sure this is just a syntax issue but cant work out what he code whould be.
    If i add it at the end of the lines it is fine, but then it throws a line break
    even when there is no data. Any help gratefully recieved. Thanks, John

    <?php if($rsCommitteeMembers->Fields('day_tel')!=NULL) echo
    $rsCommitteeMembers->Fields('day_tel'); ?>
    <?php if($rsCommitteeMembers->Fields('mobile_phone')!=NULL) echo
    $rsCommitteeMembers->Fields('mobile_phone'); ?>

    woodbridge Guest

  2. Similar Questions and Discussions

    1. Supress Acrobat error messages
      I am merging pdfs using Iac/C# with Acrobat hidden. If I drop in a broken PDF, Acrobat pops up and displays an error message. Is there a way to...
    2. DataGrid populating blank rows
      I have a remote object that retrieves an ArrayList of POJOs. It displays in my datagrid fine. Hoever, when I click a button that retrieves a single...
    3. How to supress directory listings?
      When you enter a URL into the browser (not a .cfm file, for example), it lists the various files and directories. Using Apache, there's a file...
    4. Printer friendly Pages - Supress URL at the page footer
      sounds like clientside issues....not ASP. I'd suggest a different group -- ---------------------------------------------------------- Curt...
    5. Adding blank rows after a series of records
      On Wed, 23 Jul 2003 14:04:49 -0700, "Chuck Dickson" <CDICKSO@USAIRWAYS.COM> wrote: That would be pretty tough. The only way I can think to do...
  3. #2

    Default Re: Supress Blank Rows - PHP

    woodbridge wrote:
    > <?php if($rsCommitteeMembers->Fields('day_tel')!=NULL) echo
    > $rsCommitteeMembers->Fields('day_tel'); ?>
    > <?php if($rsCommitteeMembers->Fields('mobile_phone')!=NULL) echo
    > $rsCommitteeMembers->Fields('mobile_phone'); ?>
    This should do what you want.

    <?php if($rsCommitteeMembers->Fields('day_tel')!=NULL) echo
    $rsCommitteeMembers->Fields('day_tel').'<br />'; ?>
    <?php if($rsCommitteeMembers->Fields('mobile_phone')!=NULL) echo
    $rsCommitteeMembers->Fields('mobile_phone').'<br />'; ?>


    --
    David Powers
    Author, "Foundation PHP 5 for Flash" (friends of ED)
    Co-author "PHP Web Development with DW MX 2004" (Apress)
    [url]http://computerbookshelf.com[/url]
    David Powers Guest

  4. #3

    Default Re: Supress Blank Rows - PHP

    David

    It does - it was that little full stop I overlooked!! - many thanks indeed, so easy when you know how. John
    woodbridge Guest

  5. #4

    Default Re: Supress Blank Rows - PHP

    woodbridge wrote:
    > It does - it was that little full stop I overlooked!!
    The PHP concatenation operator (aka period, full stop, dot) is tiny, and
    very easy to miss. It causes many people grief when they first start PHP
    (myself included).

    --
    David Powers
    Author, "Foundation PHP 5 for Flash" (friends of ED)
    Co-author "PHP Web Development with DW MX 2004" (Apress)
    [url]http://computerbookshelf.com[/url]
    David Powers Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139