echo "error 2"; } */ //reset item.json emptyJsonItem(); //reset livebid.json emptyJsonLiveBid(); } //if item is absent load the next item to item.json if (readJsonItem('i_id') == null) { //load next item info when the result is absent $query = "SELECT * FROM `items` WHERE `i_starttime` >= '{$curtime}' ORDER BY `i_starttime` LIMIT 1"; $res = mysqli_query($link, $query); if (mysqli_num_rows($res) > 0) { emptyJsonItem(); exportToJsonItem(); } } //Query for Next Item $next_sql = "SELECT i_name, i_imgpath, i_starttime FROM items WHERE (i_starttime > '{$curtime}') ORDER BY i_starttime LIMIT 1"; $next_result = mysqli_query($link, $next_sql); if (!$next_result) { echo "unable to connect next_2"; } if (mysqli_num_rows($next_result) > 0) { $next_itemPresent = true; $next_row = mysqli_fetch_assoc($next_result); $next_i_name = $next_row["i_name"]; $next_i_imgpath = $next_row["i_imgpath"]; $next_i_starttime = $next_row["i_starttime"]; }
function setitembefore() { emptyJsonItem(); exportToJsonItem(); }