Last active
January 20, 2019 21:29
-
-
Save winofi/6e4fc1fc2aa29451cfeab3e67b8abc7c to your computer and use it in GitHub Desktop.
suggested wspr polling interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//get start parameter (intval returns 0 for bad integer values) | |
$start = intval($_GET["minid"]); | |
//create database connection (assuming some sort of mysql is uses) | |
$db = new mysqli("localhost", "root", "root", "wspr"); | |
//query the data, limit might be modified | |
$res = $db->query("SELECT * FROM `spots` WHERE `spot_id` > ".$start." LIMIT 0, 1000;"); | |
//check database result | |
if (!$res) { | |
echo "database error\n"; | |
exit; | |
} | |
//dump the data as csv | |
while ($row = $res->fetch_row()) { | |
echo implode(",", $row)."\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment