Advertisement
Guest User

Untitled

a guest
May 31st, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. function UpdateTable()
  2. {
  3. global $connection;
  4. $username = $_POST['username'];
  5. $password = $_POST['password'];
  6. $id = $_POST['id'];
  7. $query = "UPDATE users SET "; // username is the name of the column in the database, you need the space in between
  8. $query.="username = '$username' , ";
  9. $query.= "password = '$password' ";
  10. $query.= "WHERE id = $id ";
  11. $result = mysqli_query($connection,$query);
  12. if(!$result)
  13. {
  14. die("Query failed". mysqli_error($connection));
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement