Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Survey Statistic without an Useraccount

More
7 years 8 months ago #138945 by Ben_V
Replied by Ben_V on topic Survey Statistic without an Useraccount
Sorry I've got no idea about this kind of issue... :(

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The topic has been locked.
More
7 years 8 months ago #138946 by blocka
Replied by blocka on topic Survey Statistic without an Useraccount
I found the issue! In original post ( #100885 ) the URL is either wrong, or the parameter for survey id got changed. Original post shows:

http://yourdomain/survey_stat.php?survey=1010101,2020202,3030303&title=Client%20Name

but the latest iteration of the script replaced survey with sid, so URL needs to be:

http://yourdomain/survey_stat.php?sid=1010101,2020202,3030303&title=Client%20Name
The topic has been locked.
More
5 years 6 months ago #173289 by mikebb
Replied by mikebb on topic Survey Statistic without an Useraccount
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 credentials
define('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...

hope this helps someone
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose