Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> usuwanie rekordu [PHP][MySQL], pobranie danych z formularza do funkcji delete
navaga
post 8.07.2017, 20:56:21
Post #1





Grupa: Zarejestrowani
Postów: 20
Pomógł: 0
Dołączył: 1.01.2014

Ostrzeżenie: (0%)
-----


w formularzu HTML
  1. <h1>Usuń użytkownika</h1>
  2. </div>
  3. <div>
  4. <form class="w3-container" action="controller_login.php" method="post">
  5. <p>
  6. <label class="w3-label">Nazwa uzytkownika</label>
  7. <input class="w3-input w3-border" type="text" name="usuario">
  8. </p>
  9. <p>
  10. <label class="w3-label">ID</label>
  11. <input class="w3-input w3-border" type="id" name="nr_id">
  12. </p>
  13. <p>
  14. <input type="hidden" name="usun_id" value="usun_id">
  15. <button class="w3-btn w3-red">Usuń</button>
  16. </p>
  17.  
  18. </div>


mam przycisk usuń jak pobrać dane i przekazać do funkcji?
  1. }elseif (isset($_POST['usun_id'])) {
  2. $usuario=$crud->szukajUsuario($_POST['usuario'],$_POST['Id']);
  3.  
  4. if ($usuario->getId()!=NULL) {
  5. $_SESSION['usuario']=$usuario;{
  6. "DELETE FROM `usuarios` WHERE Id= ";
  7.  
  8. }



Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
viking
post 9.07.2017, 05:31:24
Post #2





Grupa: Zarejestrowani
Postów: 6 378
Pomógł: 1116
Dołączył: 30.08.2006

Ostrzeżenie: (0%)
-----


Co robi ten nawias wokół delete?


--------------------
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 20.06.2025 - 07:54