I made a simple task, but it not work. Can anyone help me? Variables sanded from SL by llHTTPRequest do not enter in sql table. I listed here booth the LSL and the PHP script, and the result from mysql table. Data witch I put directly from PHP in db table appear OK, but data from LSL do not appear. Where I do wrong?
//-------------------
//SL object script:
//-------------------
// Conection and transfer to web MySQL server
key req_id2;
string lname;
default
{
state_entry()
{
llSetTimerEvent(10.0);
}
timer() {
llSetText("Stats...", <0.0,1.0,0.0>, 1);
}
http_response(key request_id, integer status, list metadata, string body) {
if (request_id == req_id2) {
llSay(0,"Transmision OK"
;llSay(0,body);
}
llSay(0,body); // for test
}
money(key id, integer amount)
{
lname = llKey2Name(id);
req_id2 = llHTTPRequest("http://slavalanche.3x.ro/conectsql.php", [HTTP_METHOD,"POST"], "name=" + lname + "&id=" + (string)id);
llSay(0,lname + (string)id);
}
}
//------------------------------------------------
// PHP script on web server (conectsql.php):
//------------------------------------------------
<?php
$username="user";
$password="pass";
$database="dbadress";
$db="dbname";
$name = $_POST['name'];
$key = $_POST['id'];
$azi = date("Y-m-d"
;$activat = $azi;
$table = "locatii";
$conexiune = mysql_connect($database,$username,$password);
mysql_select_db($db, $conexiune) or die( "Unable to select database"
;$query = "INSERT INTO `locatii` (`activat`, `locatie`, `proprietar`, `regiune`) VALUES ('".$activat."', '".$name."', '".$key."','Disneyland')";
mysql_query($query) or die(mysql_error());
mysql_close();
?>
//--------------------------------------------------
//The OUTPT line in table locatii from MySQL:
//--------------------------------------------------
Date: is the current date and is correct
Locatie : is empty – wrong
Proprietar : is empty – wrong
Regiune: ‘Disneyland’ – and is correct
and... I read posts about this subject founded here... but no resoult...

