Saving data to phpmyadmin

Hello everyone
I know here is many themes about this, but I have unknown problem.
I have arduino Ethernet Shield W5100 and temperature sensor DS18B20.
Need to send data to table in phpMyadmin on my computer where is started local server. Sketch works fine, as you can see in serial monitor, GET request extract data from arduino and send to php file which is connected with phpMyadmin.
No error in log file and access file. I login as root and have all privileges. But no data in table, only if I type value manually in web address, data comes.
P.S. Sorry for my bad english.


#include <SPI.h>
#include <Ethernet.h>
#include <OneWire.h>
#include <DallasTemperature.h>

#define ONE_WIRE_BUS 9
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(159, 93, 124, 95);
char server[] = "localhost"; 
EthernetClient client;
void setup()
Ethernet.begin(mac, ip);
void loop()
int temperature = sensors.getTempCByIndex(0);
if (client.connect(server, 80))
client.print( "GET localhost/write_data.php?");
client.print( "value=" );
client.println( " HTTP/1.1");
client.println( "Connection: close" );
else {
Serial.println("Connection failed");

PHP Write_data


    // Prepare variables for database connection
    $dbusername = "root";  // enter database username
    $dbpassword = "root";  // enter database password
    $server = "localhost"; 

    // Connect to your database

    $dbconnect = mysql_pconnect($server, $dbusername, $dbpassword);
    $dbselect = mysql_select_db("test",$dbconnect);

    // Prepare the SQL statement

    $sql = "INSERT INTO test.sensor (value) VALUES ('".$_GET["value"]."')";    

    // Execute SQL statement



Have you looked at your Webserver's log? If that's a Linux it's very likely to be /var/log/httpd/.

As it's a GET request you should be able to see the full request there. Just compare the one you're doing manually with the Arduino one.

Mike M.

Hmm, error log file is empty and access log file shows only request in phpmyadmin. But if I type value manually in browser, all works fine. I don't know, maybe it's problem in arduino code, especially with GET request or trouble in php ?

Finally! solved !!! Problem was in port access. It was necessary to open 80 port and replace "localhost" on IP address of my local server.