fix rencontres wiki script

This commit is contained in:
mose 2019-09-13 15:56:06 +08:00
parent 475cbf7e8e
commit 3b115d88e0

View file

@ -16,10 +16,11 @@ $db->set_charset("utf8");
function getlist($query) {
global $db;
$result = $db->query($query);
$back = array();
while ($row = $result->fetch_row()) {
$back[$row[0]] = $row[1];
if ($result = $db->query($query)) {
while ($row = $result->fetch_row()) {
$back[$row[0]] = $row[1];
}
}
return $back;
}
@ -35,10 +36,10 @@ $data = array(
'passe' => array()
);
$avenir = "select itemId, value from tiki_tracker_item_fields where fieldId=1 and datediff(utc_date(from_unixtime(
value)), utc_date(now())) >= -1 order by value asc limit 5";
$passe = "select itemId, value from tiki_tracker_item_fields where fieldId=1 and datediff(utc_date(from_unixtime(
value)), utc_date(now())) < -1 order by value desc limit 5";
$avenir = "select itemId, value from tiki_tracker_item_fields where fieldId=1 and datediff(date(from_unixtime(
value)), date(now())) >= -1 order by value asc limit 5";
$passe = "select itemId, value from tiki_tracker_item_fields where fieldId=1 and datediff(date(from_unixtime(
value)), date(now())) < -1 order by value desc limit 5";
function getevents($list) {
global $fields;