its an old thread but i'm posting this up as a way to get this working with LS3.14. it continues to be helpful starter code for reporting.
just stick this bit at the top re the database connection. I had this in a php file in the LS base directory:
Code:
<?php$config_folder=dirname(__FILE__).'/application/config/';$config_file=$config_folder.'config.php';define('BASEPATH',dirname(__FILE__).'/..');// maybe wrong but doesn't matter - constant needs to be set.$config=require($config_file);$db=$config["components"]["db"];// DB credentialsdefine('DB_SERVER',"localhost");define('DB_USER',$db["username"]);define('DB_PASSWORD',$db["password"]);//
try {$db=new PDO($db["connectionString"]."charset=utf8", DB_USER, DB_PASSWORD);}
catch(PDOException $e){//.. code as above from now on...
As bolcka reports, you may want to catch errors if sid is invalid...