# No data visible on a website sent by ttn

**URL:** <https://www.thethingsnetwork.org/forum/t/no-data-visible-on-a-website-sent-by-ttn/52751>\
**Category:** End Devices (Nodes)\
**Created:** [October 28, 2021, 2:21pm UTC](https://www.thethingsnetwork.org/forum/t/no-data-visible-on-a-website-sent-by-ttn/52751 "2021-10-28T14:21:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jan\_vanbogget](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jan_vanbogget/32/39825_2.png) [@jan\_vanbogget](https://www.thethingsnetwork.org/forum/u/jan_vanbogget)\
**Post date:** [October 28, 2021, 2:21pm UTC](https://www.thethingsnetwork.org/forum/t/no-data-visible-on-a-website-sent-by-ttn/52751/1 "2021-10-28T14:21:51Z")

</div>

Hey  
I have a Dragino LHT 65 that sends measurement data to TTN.  
The measurement data is sent from TTN to this website.  
The measurement data are visible on [this](http://vanbogget.bplaced.net/) website.  
To send the data from TTN to the website, I created a WEBHOOK.  
Works great.  
In the meantime I have created a second WEBHOOK for the same measurement values  
to be sent to another website. The settings used are  
exactly the same, obviously the login details of the second website are different.  
But very strange : the measured values are not written in the table of the  
second website, the log file is filled with data, but the MySql table becomes  
not completed … What am I doing wrong? Does anyone have a tip? Thanks for your help

The files used :  
**ttn.php**

require ‘config.php’;

$ttn\_post = file(‘php://input’);  
$data = json\_decode($ttn\_post[0]);

$sensor\_temperature = $data-\>payload\_fields-\>TempC\_SHT;  
$sensor\_humidity = $data-\>payload\_fields-\>Hum\_SHT;  
$sensor\_temperature\_2 = $data-\>payload\_fields-\>TempC\_DS;  
$sensor\_battery = $data-\>payload\_fields-\>BatV;  
$sensor\_raw\_payload = $data-\>payload\_raw;  
$gtw\_id = $data-\>metadata-\>gateways[0]-\>gtw\_id;  
$gtw\_rssi = $data-\>metadata-\>gateways[0]-\>rssi;  
$gtw\_snr = $data-\>metadata-\>gateways[0]-\>snr;

$ttn\_app\_id = $data-\>app\_id;  
$ttn\_dev\_id = $data-\>dev\_id;  
$ttn\_time = $data-\>metadata-\>time;

$db\_connect = mysqli\_connect(DATABASE\_HOST, DATABASE\_USERNAME, DATABASE\_PASSWORD, DATABASE\_NAME) or die(mysql\_error());

$server\_datetime = date(“Y-m-d H:i:s”);

mysqli\_query($db\_connect, “INSERT INTO `data` (`id`, `datetime`, `app_id`, `dev_id`, `ttn_timestamp`, `gtw_id`, `gtw_rssi`,”  
. " `gtw_snr`, `dev_raw_payload`, `dev_value_1`, `dev_value_2`, `dev_value_3`, `dev_value_4`) "  
. “VALUES (NULL, ‘$server\_datetime’, ‘$ttn\_app\_id’, ‘$ttn\_dev\_id’, ‘$ttn\_time’, ‘$gtw\_id’, ‘$gtw\_rssi’, ‘$gtw\_snr’,”  
. " ‘$sensor\_raw\_payload’, ‘$sensor\_temperature’, ‘$sensor\_temperature\_2’, ‘$sensor\_humidity’, ‘$sensor\_battery’);  
");

if (WRITE\_LOG == true) {  
file\_put\_contents(‘log.txt’, $ttn\_post[0] . PHP\_EOL, FILE\_APPEND);  
}

?\>

**config.php**

\<?php define('DATABASE\_USERNAME', 'xxxxxxxx'); define('DATABASE\_PASSWORD', 'xxxxxxx'); define('DATABASE\_NAME', 'xxxxxxx'); define('DATABASE\_HOST', 'localhost'); define('WRITE\_LOG', true); //Enable log.txt File ?\>
