so i am at this again now however i am now trying to get this data in to a mysql database surely i just take the string from the webhook and create an array then insert it into the database table as so.
<?php
$content = (file_get_contents("php://input"));
$decoded[] = json_decode($content, true);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "INSERT INTO `monitorvalues` (`dimp0`, `dimp1`, `dimp2`, `dimp3`, `dimp4`, dimp5`, `dimp6` ) VALUES ('$decoded[0]', '$decoded[1]', '$decoded[2]', '$decoded[3]', '$decoded[4]', '$decoded[5]', '$decoded[6]')";
however my webhook gives me an error
{ “event”: “photonmonitor”, “url”: “http://mysite.php”, “requestType”: “POST”, “mydevices”: true, “noDefaults”: false, “coreid”: “core id was here”, “input”: “0,1,0,0,0,0,0”, }
i thought this part would be simple am i grabbing the string wrong, should i not use the array [] ?
Or should I be creating another variable array and like this
$arvalue[] = $decoded['input'];