convert it to use one of the new mysql apis like pdo, mysqli
cba converting the restCode:// connect to db $db = new PDO('mysql:host=localhost;dbname=' . MYSQL_HOST . ';charset=utf8', MYSQL_USERNAME, MYSQL_PASSWORD); // delete old records $query = $db->query('DELETE FROM votes WHERE time > UNIX_TIMESTAMP(NOW())'); $query->execute();