<?php $conn = mysqli_connect('localhost','root','','khazar'); if(!$conn){ die("Connection failed!!!").mysqli_error(); } else{ echo "Connected succesfully"; } $sql = "SELECT * FROM students"; $result = mysqli_query($conn,$sql); if(!$result){ die("table connection problem!"); } // listing all datas from table echo "<h2>List of al records: ".mysqli_num_rows($result)."</h2>"; echo "<table>"; //if(mysqli_num_rows($result)>0){ while ($row = mysqli_fetch_assoc($result)) { echo $row['id']." | ".$row['name']." | ".$row['username']." | ".$row['password']."<br>"; ?> <form method="post" action="$_SERVER['PHP_SELF']"> <a href="f.php? id=<?php echo $row['id']?>">DELETE</a> <a href="f.php? id=<?php echo $row['id']?>">EDIT</a> <a href="f.php? id=<?php echo $row['id']?>">UPDATE</a> <!-- } --> } <?php if(isset($_GET['id'])){ $id = $_GET['id']; $sql2 = "DELETE FROM students WHERE id=".$id; mysqli_query($conn,$sql2); header("Location:".$_SERVER['PHP_SELF']); } mysqli_close($conn); ?>
}
<?php
} <?php if(isset($_GET['id'])){
<?php } if(isset($_GET['id'])){
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)