how to print database file

Discussion in 'PHP' started by pshaw, Mar 14, 2021.

  1. #1
    Hi folks. please tell me what is wrong with this code.
    -----------------------------------------------------
    <?php
    //Open a new connection to the MySQL server
    require_once "getprerentdb.php";
    
    //MySqli Select Query
    
    $results = $mysqli->query("SELECT * FROM waitlist");
      
    echo "<center>";echo date('m/d/y');echo "</center>";
    ?>
    <!DOCTYPE html><html>
    <head></head>
    <body><center>
      <h3>515 Certification Expiration Report: 06/22/2020 - 06/22/2021</h3>
    
      <table border='1' cellpadding="4">
      <thead>
      <tr>
      <th colspan=2></th>
      <th>movein</th>
      <th>effect</th>
      <th>expire</th>
      <th>days</th>
      <th colspan=3>recertification notification</th>
      <tr>
      <th>unit#</th>
      <th>resident name</th>
      <th colspan=3>date</th>
      <th>left</th>
      <th>90 day</th>
      <th>60 day</th>
      <th>30 day</th>
      </tr>
      </thead>
      <tbody>
    
      <?php
    /* -------------------------------------------------------------- */  
      while($row = mysqli_fetch_array($results))  {
    /* -------------------------------------------------------------- */
    ?>
      <tr>  
      <td><?php echo $data['unit']; ?></td>
      <td><?php echo $data['tenant']; ?></td>
      <td><?php echo $data['moveindate']; ?></td>
      <td><?php echo $data['effdate']; ?></td>
      <td><?php echo $data['expdate']; ?></td>
      <td><?php echo $data['daysleft']; ?></td>
      <td><?php echo $data['90date']; ?></td>
      <td><?php echo $data['60date']; ?></td>
      <td><?php echo $data['30date']; ?></td>
      <td><?php echo $data['late']; ?></td>
      <td><?php echo $data['comments']; ?></td>
      <td><?php echo $data['paidsum']; ?></td>
    </tr>
    <?php
      }
      ?>
      
      </tbody></table></center></body></html>
    HTML:
    ----------------------------------------------------------
    result:
    03/15/21
    515 Certification Expiration Report: 06/22/2020 - 06/22/2021

    Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in C:\xampp\htdocs\property\certlog.php on line 39
    movein effect expire days recertification notification
    unit# resident name date left 90 day 60 day 30 day
     
    Last edited by a moderator: Mar 15, 2021
    pshaw, Mar 14, 2021 IP
  2. pshaw

    pshaw Greenhorn

    Messages:
    90
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    it wasn't the query. I had an issue w/the table. thanks for being so helpful. this is solved. Soon
     
    pshaw, Mar 16, 2021 IP