Commit 6557bd37 authored by dmorley's avatar dmorley

hrm fix my messup

parent 90b67ca4
......@@ -46,11 +46,11 @@ $dbh || die('Error in connection: ' . pg_last_error());
//foreach pod check it and update db
if ($_domain) {
$sql = 'SELECT domain,statsurl,score,datecreated,weight FROM pods WHERE domain = $1';
$sql = 'SELECT domain,statsurl,score,date_created,weight FROM pods WHERE domain = $1';
$sleep = '0';
$result = pg_query_params($dbh, $sql, [$_domain]);
} elseif (PHP_SAPI === 'cli') {
$sql = 'SELECT domain,statsurl,score,datecreated,adminrating,weight FROM pods';
$sql = 'SELECT domain,statsurl,score,date_created,adminrating,weight FROM pods';
$sleep = '1';
$result = pg_query($dbh, $sql);
} else {
......@@ -63,7 +63,7 @@ while ($row = pg_fetch_all($result)) {
for ($i = 0; $i < $numrows; $i++) {
$domain = $row[$i]['domain'];
$score = (int) $row[$i]['score'];
$dateadded = $row[$i]['datecreated'];
$dateadded = $row[$i]['date_created'];
$admindb = (int) $row[$i]['adminrating'];
$weight = $row[$i]['weight'];
//get ratings
......
......@@ -8,7 +8,7 @@ $country_code = $_SERVER['HTTP_CF_IPCOUNTRY'] ?? '';
$dbh = pg_connect("dbname=$pgdb user=$pguser password=$pgpass");
$dbh || die('Error in connection: ' . pg_last_error());
$sql = 'SELECT domain,masterversion,shortversion,softwarename,monthsmonitored,score,signup,secure,name,country,city,state,lat,long,uptime_alltime,active_users_halfyear,active_users_monthly,service_facebook,service_twitter,service_tumblr,service_wordpress,service_xmpp,responsetime,dateupdated,ipv6,total_users,local_posts,comment_counts,statsurl,userrating FROM pods pods ORDER BY uptime_alltime DESC';
$sql = 'SELECT domain,masterversion,shortversion,softwarename,monthsmonitored,score,signup,secure,name,country,city,state,lat,long,uptime_alltime,active_users_halfyear,active_users_monthly,service_facebook,service_twitter,service_tumblr,service_wordpress,service_xmpp,responsetime,date_updated,ipv6,total_users,local_posts,comment_counts,statsurl,userrating FROM pods pods ORDER BY uptime_alltime DESC';
$result = pg_query($dbh, $sql);
$result || die('Error in SQL query: ' . pg_last_error());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment