execute_query($sql, self::to_list_array($params)); $res = []; // Fetch rows into sequential array while ($row = $query->fetch_assoc()) { $res[] = $row; } return $res; } // Execute SQL query with optional prepared statement and return true if query was successful public function exec_bool(string $sql, mixed $params = null): bool { $query = $this->execute_query($sql, self::to_list_array($params)); return gettype($query) === "boolean" // Type is already a bool, so return it as is ? $query // Return true if rows were matched : $query->num_rows > 0; } }