public function get_one($query, $params = []) {
		$statement = $this->get_statement($query, $params);
		$statement->execute();
		$result = $statement->fetch_assoc();

		if (count($result) == 0) {
			return null;
		}

		if (count($result) > 1) {
			throw new \Exception('Result of get_one should only contain 1 row');
		}

		$row = array_shift($result);

		if (count($row) != 1) {
			throw new \Exception('Result of get_one should only contain 1 column');
		}

		return array_shift($row);
	}
public function get_one($query, $params = []) {
		$statement = $this->get_statement($query, $params);
		$statement->execute();
		$result = $statement->fetch_assoc();

		if (count($result) == 0) {
			return null;
		}

		if (count($result) > 1) {
			throw new \Exception('Result of get_one should only contain 1 row');
		}

		$row = array_shift($result);

		if (count($row) != 1) {
			throw new \Exception('Result of get_one should only contain 1 column');
		}

		return array_shift($row);
	}
public function get_one ( $ query , $ params = [ ] ) { $ statement = $ this -> get_statement ( $ query , $ params ) ; $ statement -> execute ( ) ; $ result = $ statement -> fetch_assoc ( ) ; if ( count ( $ result ) == 0 ) { return null ; } if ( count ( $ result ) > 1 ) { throw new \ Exception ( 'Result of get_one should only contain 1 row' ) ; } $ row = array_shift ( $ result ) ; if ( count ( $ row ) != 1 ) { throw new \ Exception ( 'Result of get_one should only contain 1 column' ) ; } return array_shift ( $ row ) ; }
Get the resultset with a single row for a query

@access public
@param string $query The query to execute
@param array $params Optional parameters to replace in the query
@throws Exception Throws an Exception when the resultset contains more than one row or column
Get the resultset with a single row for a query