Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while($row = $result->fetch_assoc()) {
- $id = $row['idstudent'];
- echo "<tr><td>" . $row["idstudent"]. " </td><td> " . $row["imie"]. " </td><td> " . $row["nazwisko"]. " </td><td> "
- .$row['grupa']. "</td>".'<td><a href="usuwanie.php?action=delete&id='.$id.'">Usuń</td></tr>';
- }
- --------------------------------------------------
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "studenci";
- $conn = new mysqli($servername, $username, $password, $dbname);
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- if ($_POST['action']='delete' && isset($_POST['id'])) {
- $id = (int) $_POST['idstudent'];
- $zapytanie = "DELETE FROM student WHERE idstudent = $id";
- $polaczenie->query($zapytanie);
- }
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement