title: Trying to delete a row from database(phpmyadmin) onclick
body: <p>Trying to delete a row after clicking a delete button, but even there's no error, it doesn't work. At first I thought that it has to do with the if statements but nothing changed...Here's my delete code! Is there any other way? Thank you</p>
  
  <pre><code>&lt;?php
                  echo "&lt;table&gt;
                            &lt;caption&gt;Λίστα Χρηστών&lt;/caption&gt;
                            &lt;thead&gt;
                              &lt;tr&gt;
                                &lt;th scope='col'&gt;Ιd&lt;/th&gt;
                                &lt;th scope='col'&gt;Χρήστης&lt;/th&gt;
                                &lt;th scope='col'&gt;Διαγραφή&lt;/th&gt;
                              &lt;/tr&gt;
                            &lt;/thead&gt;";
                    $servername = "localhost";
                    $username = "root";
                    $password = "";
                    $db = "aws_chat";
  
  
                    // Create connection
                    $conn = new mysqli($servername, $username, $password, 
                    $db);
                    // Check connection
  
                    $sql = "SELECT username,email,id FROM users WHERE 
                    user_type='user'";
                    $result = $conn-&gt;query($sql);
  
                    if ($result-&gt;num_rows &gt; 0) {
                        // output data of each row
  
                    if (isset($_GET['del'])) {
                          $del = $_GET['del'];
                          //SQL query for deletion.
                          $sql_del = "DELETE * FROM users WHERE id=$del";
                      }
                        while($row = $result-&gt;fetch_assoc()) {
                            echo "&lt;tbody&gt;
                                      &lt;tr&gt;
                                        &lt;td&gt;".$row["id"]."&lt;/td&gt;
                                        &lt;td&gt;".$row["username"] ."&lt;/td&gt;
                                        &lt;td&gt;&lt;a href='delete_user.php?del= 
                        {$row['id']}'&gt;&lt;input type='button' class='btn_del' 
                        value='Delete'/&gt;&lt;/td&gt;
                                      &lt;/tr&gt;
                                  &lt;/tbody&gt;
                                    &lt;tfoot&gt;
  
                                    &lt;/tfoot&gt;";
                        }
                    } else {
                        echo "0 results";
                    }
                    echo "&lt;/table&gt;";
  
                    ?&gt;
              &lt;/center&gt;&lt;/div&gt;
  </code></pre>