Skip to content

Instantly share code, notes, and snippets.

@hemache
Created September 21, 2012 09:46
Show Gist options
  • Save hemache/3760659 to your computer and use it in GitHub Desktop.
Save hemache/3760659 to your computer and use it in GitHub Desktop.
counttimerdown no sleep
<?php
mysql_query('INSERT INTO mytable (counttimer)
VALUES ("01:11:11")');
$res = mysql_query('SELECT * FROM mytable LIMIT 1');
$row = mysql_fetch_row($res);
$timestamp = time() - strtotime($row[0]);
$finalTime = strftime('%T', $timestamp);
mysql_query("UPDATE mytable SET counttimer = '{$finalTime}' LIMIT 1");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment