- Posts: 45
- Thank you received: 1
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
$survey=117615;
$tbl_daten='lime_survey_'.$survey;
$tbl_timing='lime_survey_'.$survey.'_timings';
$col_branche=$survey.'X857X33016';
$col_gender=$survey.'X825X32956';
$col_age=$survey.'X824X329551';
$col_Kenn=$survey.'X837X32969';
$col_Kunde=$survey.'X839X32972';
$col_BQ1=$survey.'X858X33018';
$col_BQ2=$survey.'X856X33015';
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Why didn't you say this right at the start?I think I would like to generate a human readable table automatically from the database.
/* Get the responses */ $response = $myJSONRPCClient->export_responses( $sessionKey, $survey_id, 'json', // Document type : pdf,csv,xls,doc,json null, // Language code : null : default from survey 'complete', // Stautus complete|incomplete|all 'full', // Heading : code|full|abbreviated : question text, default code 'long', // answer : short|long , default : long 1, // First exported SAVEDID or NULL 100 // Last exported SAVEDID or NULL ); $decodedString = base64_decode($response); $aResponses = json_decode($decodedString, True); // Find the first response ID $aFirstResponse = $aResponses['responses'][0]; echo '<table style="border-collapse: collapse; text-align: left;">'; echo '<tr>'; // Insert column headers foreach($aFirstResponse as $key => $value) { echo '<th style="border: 1px solid #CCC; padding: 2px 7px;">'.$key .'</th>'; } echo '</tr>'; foreach($aResponses['responses'] as $key => $row) { echo '<tr>'; // Insert the data foreach($row as $key => $item) { echo '<td style="border: 1px solid #CCC; padding: 2px 7px;">'.$item .'</td>'; } echo '</tr>'; } echo '</table>'; // release the session key $myJSONRPCClient->release_session_key( $sessionKey );
Please Log in to join the conversation.
Please Log in to join the conversation.