Results 1 to 3 of 3

Thread: PHP help to exclude rows without data
      
   

  1. #1
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    583

    Default 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:
    }

  2. #2
    Join Date
    Jan 2008
    Location
    Colorado
    Posts
    78

    Default 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.

  3. #3
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    583

    Default 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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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