Need help for Arduino web client sending data to DBserver (php and mySQL)

Hi everyone,
I'm newbe in Arduino and Network communication.
I have try to send measured data with Arduino as WebClient to a DBServer done with XAMPP, but I can't get the data to the DBserver even if the webclient connects to it.
Here is my Arduino sketch:

#include <SPI.h>
#include <Ethernet.h>
#include "EmonLib.h"

const int numbFase = 3;
EnergyMonitor emon[numbFase];

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress server(10, 10, 13, 156);
IPAddress ip(10, 10, 13, 246);

EthernetClient client;

void setup() {

Serial.begin(9600);
emon[0].current(A0, 56.9); // Current: input pin, calibration.
emon[0].voltage(A1, 357.8, 0.6); // Voltage: input pin, calibration, phase_shift
emon[1].current(A2, 54.54); // Current: input pin, calibration.
emon[1].voltage(A3, 182.2, 0.6); // Voltage: input pin, calibration, phase_shift
emon[2].current(A4, 54.54); // Current: input pin, calibration.
emon[2].voltage(A5, 175.5, 0.6); // Voltage: input pin, calibration, phase_shift

Ethernet.begin(mac, ip);

delay(1000);
}

void loop() {

for(int i=0; i < numbFase; i++) {
emon*.calcVI(20,2000);*
_ emon*.serialprint();_
_
// emon[0].calcVI(20,2000);_
_
// emon[0].serialprint();_
_
// emon[1].calcVI(20,2000);_
_
// emon[1].serialprint();_
_
// emon[2].calcVI(20,2000);_
_
// emon[2].serialprint();*_

* Serial.println("GET /monitoringlistrik/emonTerima.php?");*
* Serial.print("idEMon=");*
* Serial.print(i);*
* Serial.println("&");*
* Serial.print("rP=");*
_ Serial.print(emon*.realPower);
Serial.println("&");
Serial.print("aP=");
Serial.print(emon.apparentPower);
Serial.println("&");
Serial.print("pF=");
Serial.print(emon.powerFactor);
Serial.println("&");
Serial.print("Vrms=");
Serial.print(emon.Vrms);
Serial.println("&");
Serial.print("Irms=");
Serial.print(emon.Irms);
Serial.println(" HTTP/1.1");
Serial.println("Host: 10.10.13.160");
Serial.println("Connection: close");
Serial.println();
Serial.println();*_

* if (client.connect(server, 80)) {*
* Serial.println("connected");*
* // Make a HTTP request:*
* client.print("GET /monitoringlistrik/emonTerima.php?");*
* client.print("idEMon=");*
* client.print(i);*
* client.print("&");*
* client.print("rP=");*
_ client.print(emon*.realPower);
client.print("&");
client.print("aP=");
client.print(emon.apparentPower);
client.print("&");
client.print("pF=");
client.print(emon.powerFactor);
client.print("&");
client.print("Vrms=");
client.print(emon.Vrms);
client.print("&");
client.print("Irms=");
client.print(emon.Irms);
client.println(" HTTP/1.1");
client.println("Host: 10.10.13.60");
client.println("Connection: close");
client.println();
client.println();
client.stop();
} else {*_

* Serial.println("connection failed");*
* }*
* }*
* delay(3300);*
}
and this is the php file that will read and write the data to mySQL Database :
<?php
if($_GET) {

* $idEMon = $GET['idEMon'];
$rP = $GET['rP'];
$aP = $GET['aP'];
$pF = $GET['pF'];
$Vrms = $GET['Vrms'];
$Irms = $GET['Irms'];
$sql = "INSERT INTO data_lab (idEMon,rP,aP,pF,Vrms,Irms) VALUES ($idEMon,$rP,$aP,$pF,$Vrms,$Irms)";*

* echo $sql;*

* $server = "localhost";*

* $usernameDatabase = "arduino";*

* $passwordDatabase = "";*
* $databaseName = "Energy_Monitoring";
$con=mysqli_connect($server,$usernameDatabase,$passwordDatabase,$databaseName) or die("Koneksi gagal");
$query = mysqli_query($con,$sql);
mysqli_close($con);*

if ($query)
* { echo "Sukses";*
* }*

else
* {*
* echo "Gagal" . $query;*
* }*
}
?>
emonKirim.ino (3.92 KB)

      client.println(" HTTP/1.1");
      client.println("Host: 10.10.13.60");
      client.println("Connection: close");
      client.println();
      client.println();
      client.stop();

You sent a GET request to a server, then told it to f**k off, without reading any reply it might have generated. Why?

Since you are running Apache, you should be able to look at the log files. What do they tell you is happening?

I have a function that I call in php scripts:

function PrintGetVars($caller)
{
	$received = "Get vars\r\n\r\n";
	
	foreach($_GET as $key=>$value)
	{
		$received .= "$key = [$value]\r\n";
	}
	
	$printout = fopen("C:\\tmp\\get_variables.txt",'a');
	fwrite($printout, "Number of get variables in $caller: ");
	fwrite($printout, count($_GET));
	fwrite($printout, "\r\n");
	fwrite($printout, $received);
	fwrite($printout, "\r\n");
	fclose($printout);
}

$caller is a string, so any string (I use the name of the php script) will do. Change where the file gets created to suit your system. See what actually gets passed to the function, in the $_GET array, if the script even gets executed.