I am using olap4php to connect to the Mondrian's default FoodMart XML schema and I need to run an MDX query on it to see whether I can get it to work.
My current code is as below :-
require_once( 'olap4php/autoload.php' );
use OLAP4PHP\Provider\XMLA\XMLAConnection;
$endpoint = "http://server:8888/myproject/FoodMart.xml";
$properties = array(
XMLAConnection::PROP_CATALOG => 'FoodMart',
XMLAConnection::PROP_DATASOURCE => 'Provider=Mondrian;DataSource=FoodMart'
);
$connection = new XMLAConnection( $endpoint, $properties );
if ($connection) {
echo "yes";
}
The output is "yes" and so I believe the connection is working. Now I want to run an MDX query on it, some query like
SELECT {[Measures].[Unit Sales], [Measures].[Store Sales]} ON COLUMNS,
{[Product].members} ON ROWS
FROM [Sales]
WHERE [Time].[1997].[Q2]