Skip to content

Instantly share code, notes, and snippets.

@winofi winofi/poll.php
Last active Jan 20, 2019

Embed
What would you like to do?
suggested wspr polling interface
<?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
You can’t perform that action at this time.