user27363: I have got this quick sketch that post data to mysql db using php add.php module.
#include <SFE_BMP180.h>
#include <SPI.h>
#include <Ethernet.h>
#include<dht.h>
dht DHT;

// You will need to create an SFE_BMP180 object, here called "pressure":
SFE_BMP180 bmp;

#define DHT11_PIN 2

double tempInC;
int humidity;

byte mac[] = {
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
IPAddress ip(192, 168, 1, 177);
char server[] = "192.168.1.3";

EthernetClient client;
byte php_server[] = {192 , 168 , 1 , 3};

long previousMillis = 0;
unsigned long currentMillis = 0;
long interval = 250000; // READING INTERVAL

String data;

void setup() {
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  if (bmp.begin()) {
    Serial.println("BMP init Success");
  }

  // start the Ethernet connection:
  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // try to congifure using IP address instead of DHCP:
    Ethernet.begin(mac, ip);
  }

  // give the Ethernet shield a second to initialize:
  delay(1000);
  Serial.println("connecting...");
  data = "";
}

void loop() {
  int chk = DHT.read11(DHT11_PIN);
  char status;
  status = bmp.startTemperature();
  if (status != 0) {
    delay(status);
    status = bmp.getTemperature(tempInC);
  }
  else Serial.println("error retrieving temperature measurement\n");

  humidity = DHT.humidity;
  data = "?temp1=" + String(tempInC) + "&hum1=" + String(humidity);

  if (client.connect(server, 80)) {
    Serial.print("connected. My IP is ");
    Serial.println(Ethernet.localIP());
    client.println("POST /arduino/add.php HTTP/1.1");
    client.println("Host: 192.168.1.3");
    client.println("Content-Type: application/x-www-form-urlencoded");
    client.print("Content-Length: ");
    client.println(data.length());
    client.println();
    client.print(data);
  }
  else {
    Serial.println("connection failed");
  }
  Serial.println(data);
  // if there are incoming bytes available
  // from the server, read them and print them:
  if (client.available()) {
    char c = client.read();
    Serial.print(c);
  }
  if (client.connected()) {
    client.stop();  // DISCONNECT FROM THE SERVER
  }
  delay(300000); // WAIT FOR A WHILE BEFORE SENDING AGAIN
}

but its not updating the database, using the below add.php file from arduino web-client.ino
<?php
        include("connect.php");

        $link=Connection();

        $temp1=$_POST["temp1"];
        $hum1=$_POST["hum1"];

        $query = "INSERT INTO `tempLog` (`temperature`, `humidity`) 
                VALUES ('".$temp1."','".$hum1."')"; 

        mysql_query($query,$link);
        mysql_close($link);

        header("Location: index.php");
?>

i checked in mysql prompt which is also the result displayed if I open the server url : 192.168.1.3/arduino/index.php
mysql> select * from tempLog;
+---------------------+-------------+----------+
| timeStamp           | temperature | humidity |
+---------------------+-------------+----------+
| 2016-11-28 11:50:37 |           0 |        0 |
| 2016-11-28 12:30:25 |           0 |        0 |
+---------------------+-------------+----------+
2 rows in set (0.00 sec)

I don't know how the first entry got created but second one I created by manually executing the url 192.168.1.3/arduino/add.php?temp1=26.64&hum1=18
the index page is showing he data from db as shown above in sql, that means connection is established and mysql and table is fetched from correct db. i.e. arduinoSensorData  in my case.
my serial monitor window got updated:
BMP init Success
connecting...
connected. My IP is 192.168.1.131
?temp1=26.64&hum1=18
connected. My IP is 192.168.1.131
?temp1=26.64&hum1=18
connected. My IP is 192.168.1.131
?temp1=26.57&hum1=18

which means arduino is not able to put data to db using add.php

user27363: I came to learn in my php code posted above, I am using $_POST variable when I should rather be using $_GET
In the PHP script, there are $_GET and $_POST variables that contain the data passed to the script, depending on the method used to to activate the script.
so using $temp1=$_GET["temp1"]; and $hum1=$_GET["hum1"]; fixes the problem.

27363: <p>I have got this quick sketch that post data to mysql db using php add.php module.</p>

<pre><code>#include &lt;SFE_BMP180.h&gt;
#include &lt;SPI.h&gt;
#include &lt;Ethernet.h&gt;
#include&lt;dht.h&gt;
dht DHT;

// You will need to create an SFE_BMP180 object, here called "pressure":
SFE_BMP180 bmp;

#define DHT11_PIN 2

double tempInC;
int humidity;

byte mac[] = {
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
IPAddress ip(192, 168, 1, 177);
char server[] = "192.168.1.3";

EthernetClient client;
byte php_server[] = {192 , 168 , 1 , 3};

long previousMillis = 0;
unsigned long currentMillis = 0;
long interval = 250000; // READING INTERVAL

String data;

void setup() {
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  if (bmp.begin()) {
    Serial.println("BMP init Success");
  }

  // start the Ethernet connection:
  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // try to congifure using IP address instead of DHCP:
    Ethernet.begin(mac, ip);
  }

  // give the Ethernet shield a second to initialize:
  delay(1000);
  Serial.println("connecting...");
  data = "";
}

void loop() {
  int chk = DHT.read11(DHT11_PIN);
  char status;
  status = bmp.startTemperature();
  if (status != 0) {
    delay(status);
    status = bmp.getTemperature(tempInC);
  }
  else Serial.println("error retrieving temperature measurement\n");

  humidity = DHT.humidity;
  data = "?temp1=" + String(tempInC) + "&amp;hum1=" + String(humidity);

  if (client.connect(server, 80)) {
    Serial.print("connected. My IP is ");
    Serial.println(Ethernet.localIP());
    client.println("POST /arduino/add.php HTTP/1.1");
    client.println("Host: 192.168.1.3");
    client.println("Content-Type: application/x-www-form-urlencoded");
    client.print("Content-Length: ");
    client.println(data.length());
    client.println();
    client.print(data);
  }
  else {
    Serial.println("connection failed");
  }
  Serial.println(data);
  // if there are incoming bytes available
  // from the server, read them and print them:
  if (client.available()) {
    char c = client.read();
    Serial.print(c);
  }
  if (client.connected()) {
    client.stop();  // DISCONNECT FROM THE SERVER
  }
  delay(300000); // WAIT FOR A WHILE BEFORE SENDING AGAIN
}
</code></pre>

<p>but its not updating the database, using the below <strong>add.php</strong> file from arduino <strong>web-client.ino</strong></p>

<pre><code>&lt;?php
        include("connect.php");

        $link=Connection();

        $temp1=$_POST["temp1"];
        $hum1=$_POST["hum1"];

        $query = "INSERT INTO `tempLog` (`temperature`, `humidity`) 
                VALUES ('".$temp1."','".$hum1."')"; 

        mysql_query($query,$link);
        mysql_close($link);

        header("Location: index.php");
?&gt;
</code></pre>

<p>i checked in mysql prompt which is also the result displayed if I open the server url : 192.168.1.3/arduino/index.php</p>

<pre><code>mysql&gt; select * from tempLog;
+---------------------+-------------+----------+
| timeStamp           | temperature | humidity |
+---------------------+-------------+----------+
| 2016-11-28 11:50:37 |           0 |        0 |
| 2016-11-28 12:30:25 |           0 |        0 |
+---------------------+-------------+----------+
2 rows in set (0.00 sec)
</code></pre>

<p>I don't know how the first entry got created but second one I created by manually executing the url 192.168.1.3/arduino/add.php?temp1=26.64&amp;hum1=18</p>

<p>the index page is showing he data from db as shown above in sql, that means connection is established and mysql and table is fetched from correct db. i.e. <em>arduinoSensorData</em>  in my case.</p>

<p>my serial monitor window got updated:</p>

<pre><code>BMP init Success
connecting...
connected. My IP is 192.168.1.131
?temp1=26.64&amp;hum1=18
connected. My IP is 192.168.1.131
?temp1=26.64&amp;hum1=18
connected. My IP is 192.168.1.131
?temp1=26.57&amp;hum1=18
</code></pre>

<p>which means arduino is not able to put data to db using add.php</p>
 27363: <p>I came to learn in my php code posted above, I am using <code>$_POST</code> variable when I should rather be using <code>$_GET</code></p>

<p>In the PHP script, there are $_GET and $_POST variables that contain the data passed to the script, depending on the method used to to activate the script.</p>

<p>so using <code>$temp1=$_GET["temp1"];</code> and <code>$hum1=$_GET["hum1"];</code> fixes the problem.</p>
