function mysqli_multi_sub_query($dblink, $query, $supress_errors = false) { # Handling our query $ms = microtime(true); $result = mysqli_multi_query($dblink, $query); $queries_time = microtime(true) - $ms; $queries_count = 1; # Error handling !$result && !$supress_errors && mysqli_log_error($dblink, $query); # Handling second+ queries while (mysqli_more_results($dblink)) { $result = mysqli_next_result($dblink); !$result && !$supress_errors && mysqli_log_error($dblink, $query); $queries_count++; } # Logging the query mysqli_log_query($dblink, $query, $queries_time / $queries_count, 0); # Returning if the query was processed if ($result) { return true; } }
function mysqli_sub_query($dblink, $query) { # Handling our query $ms = microtime(true); $result = mysqli_query($dblink, $query); mysqli_log_query($query, microtime(true) - $ms); # Error Handling !$result && mysqli_log_error($dblink, $query); # Returning if the query was processed if ($result) { return true; } }