Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. <?php
  2.  
  3. $con = mysql_connect("localhost", "root", "");
  4.  
  5.  
  6.  
  7. if (!$con)
  8.  
  9. {
  10.  
  11. die('Could not connect: '.mysql_error());
  12.  
  13. }
  14.  
  15.  
  16.  
  17. mysql_select_db("gustavvvv", $con);
  18.  
  19.  
  20.  
  21. $result = mysql_query("SELECT * FROM bibliotekarie");
  22.  
  23.  
  24.  
  25.  
  26. $row = mysql_fetch_array($result);
  27. $id = $row['bibliotekarie_id'];
  28. $anvandarnamn = $row['bibliotekarie_anvandarnamn'];
  29. $losenord = $row['bibliotekarie_losenord'];
  30. $personnr = $row['bibliotekarie_personnr'];
  31.  
  32.  
  33.  
  34. mysql_close($con);
  35.  
  36. ?>
  37.  
  38. <html>
  39. <table border=1 width=900>
  40. <tr>
  41. <th>ID</th>
  42. <th>Användarnamn</th>
  43. <th>Lösenord</th>
  44. <th>Personnummer</th>
  45. <tr>
  46. <td>
  47. <input type="text" name="id" value="<?php echo $id; ?>" />
  48. </td>
  49. <td>
  50. <input type="text" name="anvandarnamn" value="<?php echo $anvandarnamn; ?>" />
  51. </td>
  52. <td>
  53. <input type="password" name="losenord" value="<?php echo $losenord; ?>" />
  54. </td>
  55. <td>
  56. <input type="text" name="personnr" value="<?php echo $personnr; ?>" />
  57. </td>
  58. </table>
  59. <input type="submit" value="Spara" />
  60. <a href=index.php>Tillbaka</a>
  61. </html>
  62.  
  63. <?php
  64. $idnew = $_GET['id'];
  65.  
  66. mysql_query("UPDATE bibliotekarie SET `id` =".$idnew. ", WHERE `id` = 1337");
  67.  
  68. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement