SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $sql = mysqli_query($conn, "SELECT id, imie, nazwisko, klasa FROM uczniowie");
  2.  
  3. while ($row = $sql->fetch_assoc())
  4. {
  5. echo '<option value="'.$row['id'].'"> '.$row['imie'].' '.$row['nazwisko'].' '.$row['klasa'].' </option>';
  6.  
  7. // close while loop
  8. }
  9.  
  10.  echo   '<input name="popr_im" placeholder="popraw imie" style="position:absolute; left:1%; top: 10%;"></input>
  11.     <input name="popr_na" placeholder="popraw nazwisko" style="position:absolute; left:1%; top: 15%;"></input>
  12.     <input name="popr_kl" placeholder="popraw klase" style="position:absolute; left:1%; top: 20%;"></input>
  13.     <button type="submit">zmien</button> ';
  14. $id = $_POST['id'];
  15. $a = $_POST['popr_im'];
  16. $b = $_POST['popr_na'];
  17. $c = $_POST['popr_kl'];
  18. $sql2 = mysqli_query($conn, "UPDATE `uczniowie` SET `imie`='$a', `nazwisko`= '$b', `klasa`='$c' WHERE id='$id'");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top