Skip to content

Instantly share code, notes, and snippets.



Last active Mar 26, 2021
What would you like to do?
1k lang
#customers {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
#customers td, #customers th {
border: 1px solid #ddd;
padding: 8px;
#customers tr:nth-child(even){background-color: #f2f2f2;}
#customers tr:hover {background-color: #ddd;}
#customers th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #4CAF50;
color: white;
<form method='GET' action='sample.php'>
<tr><td>Patient No.</td> <td><input type=text size=2 name=txtno></td></tr>
<tr><td>Name</td> <td><input type=text size=20 name=txtname></td></tr>
<tr><td>Address</td> <td><input type=text size=20 name=txtaddress></td></tr>
<tr><td>Contact Info</td><td> <input type=text size=10 name=txtcontact></td></tr>
<tr><td colspan=2 align=right> <input type=submit value="Save"></td></tr>
if (isset($_GET["txtno"])) {
$txtname = $_GET["txtname"];
$txtno = $_GET["txtno"];
$txtaddress = $_GET["txtaddress"];
$txtcontact = $_GET["txtcontact"];
$sql = "
INSERT INTO tblpatient(fldname,fldpatientinfo,fldaddress,fldcontact)
if (isset($_GET["txtdelno"])) {
$sql="DELETE FROM tblpatient WHERE fldpatientno='txtdelno'";
$sql="SELECT ∗ FROM tblpatient";
$result = $conn>query($sql);
<table border=1 width=500 id=customers>";
<th></th><!-- Is this intentionally left blank? -->
<th>Patient No.</th>
<th>Contact Info</th>
<?php while($row = $result->fetch_assoc()) { ?>
<a href="sample.php?txtdelno=<?php echo $row['fldpatientno']; ?>">
<img src="delete.png" width=20 height=20 />
<td><?php echo $row["fldpatientno"]; ?></td>
<td><?php echo $row["fldname"]; ?></td>
<td><?php echo $row["fldaddress"]; ?></td>
<td><?php echo $row["fldcontact"]; ?></td>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment