fetch_assoc()) {} return $data; } } // ======================================= // This function returns the result of a simple query (returning EXACTLY one field – like the COUNT(*) function) // Ravenheart // function DBShortQuery($query) { global $link; $res = ""; if (!$link) die ('Connection broken'); else { $result = mysqli_query($link, $query); if ($result===false) { echo "
".mysqli_error($link)."
"; } $row = mysqli_fetch_all($result); $res = $row[0]; } return $res; }; // ======================================= // This function returns the result of a query as a table [n, number_of_fields] // NOTE: when processing in the main file, use the format {$table[x][y]} // Ravenheart // function DBArrayQuery($query) { global $link; if (!$link) die ('Connection broken'); else { $result = mysqli_query($link, $query); if ($result===false) { echo "".mysqli_error($link)."
"; } $rows = mysqli_fetch_all($result, MYSQLI_NUM); } if ($rows==NULL) $rows = array(); return $rows; }; function DumpResult($x, $borderwidth=1) { echo "$kom | "; echo "