output value LS database

4 years 10 months ago #102536 by RoMaier
RoMaier created the topic: output value LS database

I hope you can help me, I'm already despair :( How can I access the LS database, and let me spend a value with a script?
I tried it this way:

include "mysql_ls.php"; //the conection to database works!//


$query = "SELECT 71744X7X30 FROM lime_survey_71744 WHERE id = $id";
$result = mysql_query($query);
if (!$result) {include ("error.php"); die("DATABASE ERROR: ".mysql_error());}
while($row = mysql_fetch_object($result))
{$byear = $row->71744X3X30;}


But the problem is that PHP not accepted the SGQA on the line "{$byear = $row->71744X3X30;}". I think because the variable name starts with a number.
Alternatively, the idea was to pass the required variables into a new database and rename it, such as:


However, I can only pass 4 variables at the end URL, but consumes 32 variables. Can I extend the End_URL field? Or can I output values in any other way?

Many Thanks!

Please Log in or Create an account to join the conversation.

4 years 10 months ago - 4 years 10 months ago #102648 by Marksom
Marksom replied the topic: output value LS database
For me PHP usually accept a call to the mysql database.
PHP 5.4
mysql 5.5.2
mysql_select_db($db, $show);	
$query = "SELECT $name FROM lime_survey_$code";
$result = mysql_query($query, $show) or die(mysql_error());

Can your PHP version, but try to turn it into a first variable.
Hope this helps
Last Edit: 4 years 10 months ago by Marksom.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!