<html> <body> <form action="getdata.php" method="post"> Name:<input type="text" name="fname"/> Age:<input type="text" name="age"/> <input type="submit"/> </form> </body> </html>
<?php $con=mysqli_connect("localhost:8080","root","","Test"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * FROM Persons"); echo "<table border='1'> <tr> <th>Firstname</th> <th>Lastname</th> </tr>"; while($row = mysqli_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['FirstName'] . "</td>"; echo "<td>" . $row['LastName'] . "</td>"; echo "</tr>"; } echo "</table>"; mysqli_close($con); ?>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)