Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //include the database connectivity setting
- include ("inc/dbconn.php");
- //include the navigation bar
- include ("inc/header-navbar.php");?>
- <div class="container">
- <br>
- <br>
- <div class="row">
- <div class="col-md-9" name="maincontent" id="maincontent">
- <!-- ***********Edit your content STARTS from here******** -->
- <h5>Template for PHP-MySQL Exercises</h5>
- Employee Listing<br>
- <?php
- //sql code to capture name & id
- $sql="select EMPNO, FIRSTNAME, LASTNAME
- from employee";
- $qr=mysqli_query($db,$sql);
- if(mysqli_num_rows($qr)==0){//record not found
- echo "Record not found";
- }
- else{//record listing
- echo "<table class='table table-striped table-bordered'>
- <thead>
- <tr>
- <th>EMPNO</th>
- <th>FULLNAME</th>
- </tr>
- </thead>";
- echo "<tbody>";
- while($rec=mysqli_fetch_array($qr)){
- echo "<tr>";
- echo
- "<td>".$rec['EMPNO'].
- "</td>
- <td>".
- $rec['FIRSTNAME']." ".
- $rec['LASTNAME'].
- "</td>";
- echo "</tr>";
- }
- echo "</tbody>
- </table>";
- }
- ?>
- <!-- ***********Edit your content ENDS here******** -->
- </div><!-- end main content -->
- <?php
- //include the sidebar menu
- include ("inc/sidebar-menu.php");
- ?>
- </div><!-- end row -->
- </div><!-- end container -->
- <?php
- //include the footer
- include ("inc/footer.php");?>
Advertisement
Add Comment
Please, Sign In to add comment