Guest User

Untitled

a guest
Sep 30th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. <?php
  2. $hostname = 'localhost';
  3. $username = 'root';
  4. $password = '';
  5. $db_name = 'somedb';
  6. $conn = mysqli_connect($hostname, $username, $password, $db_name);
  7. if (isset($_POST['abc'])){
  8. $date_today = date('Y-m-d');
  9. $somecount=("INSERT INTO sometable (today,somecount) VALUES ('".$date_today."', '') ON DUPLICATE KEY UPDATE somecount=somecount+1");
  10. mysqli_query($conn, $somecount);
  11. }
  12.  
  13. ?>
  14.  
  15. <form method="post" action="some.php">
  16. <input type="submit" name="abc">
  17. </form>
Add Comment
Please, Sign In to add comment