PHP help to exclude rows without data

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Rob (SA)
    Lieutenant Colonel

    • Nov 2006
    • 586

    PHP help to exclude rows without data

    Hi Folks,

    I have managed to get a page to populate reflecting data from a table in mysql.

    I have also managed to find this phph that will help me to exclude rows that do not have data.

    I understand that my phph file has 2 equalities [WHERE//AND], and i have several fields.

    I need to insert the Code below, after the while() statement, and that is part of my difficulty - where does the while() statement end in my php file?

    PHP Code:
    if($row['d32'] != '' && $row['d41'] != '' && $row['d42'] != '' && $row['d51'] != '' && $row['d52'] != '' && $row['d61'] != '' && $row['d62'] != '' && $row['d71'] != '' && $row['d72'] != '' && $row['d81'] != '' && $row['d82'] != '' && $row['d91'] != '' && $row['d92'] != '' && $row['d101'] != '' && $row['d111'] != '' && $row['d112'] != '' && $row['d121'] != '' && $row['d122'] != '' && $row['d131'] != '' && $row['d132']) {




    PHP Code:
    echo '</td></tr>';


    I have several if statements but am not sure which if statement I should be using? to paste the following:

    PHP Code:
    }
    Kind Regards
    Rob
    www.gnjgf.co.za
    www.oryan-projects.com
  • mattski
    First Sergeant

    • Jan 2008
    • 78

    #2
    Re: PHP help to exclude rows without data

    Your while statement isn't listed in the code you pasted here but with multiple lines the while statement is enclosed in curly braces like so:

    Code:
    while(some condition here){
    
      Stuff to execute of display here
      more stuff...
    
    } //End of While
    The first curly brace starts the code that will be executed when your while condition is met. The last curly brace closes out the while statement.
    Mattski

    http://www.ScorpioFire.com


    Comment

    • Rob (SA)
      Lieutenant Colonel

      • Nov 2006
      • 586

      #3
      Re: PHP help to exclude rows without data

      Hi ,

      Thanks for the help.

      It helps to understand these things no matter how simple they may be
      Kind Regards
      Rob
      www.gnjgf.co.za
      www.oryan-projects.com

      Comment

      Working...
      X