I tried to pass JSON string into MySQL DB with PHP. But into DB table inserts "Array", and in the debug.txt file inserts normal string.
require("conf/mysql.php");
if(!empty($_POST)){
$json = $_REQUEST;
$obj = $json;
$sql = "INSERT INTO server_info (`data`) VALUES ('".mysqli_real_escape_string($obj)."')";
file_put_contents("debug.txt", $obj);
if (!$result = $mysqli->query($sql)) file_put_contents("db.log", "DB failure while executing query\n$mysqli->error\n$sql");
}
else
die("Illegal method!");
Debug.txt
{"Map":"gm_metro_nekrasovskaya_line_v3","PlayerCount":1.0,"Wagons":0.0,"MaxWagons":6.0,"MaxPlayers":15.0,"ServerName":"Verona General Metrostroi","Players":[{"SteamID":"STEAM_0:1:57045033","Nick":"thescs","Rank":"superadmin","Time":8776.0,"Position":"Депо"}]}
Whats wrong?