Server IP : 162.240.98.243 / Your IP : 18.226.251.70 Web Server : Apache System : Linux server.bti.yaw.mybluehostin.me 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : btiyawmy ( 1003) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/btiyawmy/public_html/login.easenup.in/ |
Upload File : |
<?php $connect = mysqli_connect("localhost", "easenuph", "@#admin@#", "easenuph_hand2secure"); $query ="SELECT * FROM patient ORDER BY srno desc"; $result = mysqli_query($connect, $query); ?> <!DOCTYPE html> <html> <head> <title>Webslesson Tutorial | Export Mysql Table Data to CSV file in PHP</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" /> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <br /><br /> <div class="container" style="width:900px;"> <h2 align="center">Export Mysql Table Data to CSV file in PHP</h2> <h3 align="center">Employee Data</h3> <br /> <form method="post" action="export.php" align="center"> <input type="submit" name="export" value="CSV Export" class="btn btn-success" /> </form> <br /> <div class="table-responsive" id="employee_table"> <table class="table table-bordered"> <tr> <th width="5%">ID</th> <th width="25%">Name</th> </tr> <?php while($row = mysqli_fetch_array($result)) { ?> <tr> <td><?php echo $row["patientid"]; ?></td> <td><?php echo $row["patientname"]; ?></td> </tr> <?php } ?> </table> </div> </div> </body> </html>