how to pass data from arduino to PHP then to Ms SQL

I am unable to pass data from my arduino to my php.
I have to tried several method in this forum but still get the same result.
this is my PHP coding

<?php $serverName = "PSYS393PC"; $connectionInfo = array( "Database"=>"Yardage_Meter", "UID"=>"yeow", "PWD"=>"12345678"); $conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn === false ) { die( print_r( sqlsrv_errors(), true)); } echo"connected. "; $REV=$_GET['REV']; $LENGTH=$_GET['LENGTH']; $sql = "INSERT INTO yardage( REV,LENGTH) VALUES ( '".$REV."','".$LENGTH."')"; $params =array(1, "value"); $stmt = sqlsrv_query( $conn, $sql, $params); if( $stmt === false ) { die( print_r( sqlsrv_errors(), true)); } ?>

and below is my arduino coding

if (client.connect(server, 80))
{
Serial.println(“connccted”);
Serial.println(server);
client.println("GET /test.php?REV-LENGTH HTTP/1.1 ");
client.println(“Host: 192.168.43.189”);
client.print(REV);
client.print(LENGTH);

}
if (client.connected())
{ client.stop(); }

can someone tell me how to solve this?

It's related to HTTP protocol, not Arduino.
You're sending it wrong. $_GET will accept parameters like "GET /test.php?REV=value&LENGTH=anothervalue".

Try building string like this and it should be fine.

I have tried the method that u shown above, but the error still the same, is there any another problem regarding to the php file?

Hmm, can you show the code please?
Can you try this? BTW It's not tested.

if (client.connect(server, 80))
{
    String toSend = String("GET /test.php?REV=" + String(REV) + "&LENGTH=" + String(LENGTH) + " HTTP/1.1\r\n");
    Serial.println("connccted");
    Serial.println(server);
    client.print(toSend);
    client.print("Host: 192.168.43.189\r\n");
    client.print("\r\n");
}

if (client.connected())
{
    client.stop();
}

I try on this one yesterday, but is still the same

      if (client.connect(server, 80)) 
        {
            Serial.println("connccted");
            Serial.println(server);
            client.println("POST /localhost/test/test.php?REV=REV & LENGTH=LENGTH HTTP/1.1 "); 
            client.println("Host: 192.168.43.189"); 
            client.print(REV);
            client.print(LENGTH);

        }
        if (client.connected())
        { client.stop(); }

then this is my complete coding

#include <Wire.h>
#include <GroveColorSensor.h>
#include <SPI.h>
#include <Ethernet.h>

byte mac[] = {0x90, 0xB6, 0x86, 0x03, 0x08, 0x31 };
IPAddress ip(192,168,43,163);
  
volatile uint8_t REV;//(REV - 1) is the number of revolutions
 
uint16_t rpm;//revolutions per minute
 
uint32_t timeold;
uint32_t rotating_time;
float Length;
float LENGTH;

char server[] = "192.168.43.189";
EthernetClient client;

void setup()
{
  Serial.begin(9600);
  Ethernet.begin(mac, ip);
  Wire.begin();
  attachInterrupt(0, rpm_fun, RISING); // Interrupt triggers on rising edge; 
                    //when the sensor turns off(the magnet leaves).
}

void loop()
{
  int red, green, blue;
  int nred, ngreen, nblue;
  float nTRGB, TRGB,R;

  GroveColorSensor colorSensor;
    
    nred = red;
    ngreen = green;
    nblue = blue;

 if(nred+ngreen+nblue>0 &&nred+ngreen+nblue<765)
   {
 
    //calculation of total old RGB
    nTRGB = nred*65536 + ngreen*256 + nblue;
    }

    //new value of RGB
    colorSensor.readRGB(&red, &green, &blue);    //Read RGB values to variables.

    
     if(red+green+blue>0 &&red+green+blue<765)
{    
      //calculation of total RGB
    TRGB = red*65536+ green*256 + blue;
    }

    //comparison of nTRGB and TRGB
    R = (TRGB/nTRGB)*100;
    

    //condition for the sensitivity of the sensor,here giving +-15% tolerance,can be adjusted.
      if(R>115)
          { //Serial.print( "\t\t\t record\n");
          calculation();
         
          }
      else if(R<85)
          { //Serial.print( "\t\t\t record\n");
          calculation();
          }
      else
          {
            //Serial.print( "not record\n");
          }
  
}
void rpm_fun()
{
  REV++;
}

//length calculation function.
void calculation()
{
  
    Length=REV*3.142*10*2;
    LENGTH=Length/100;
    if (LENGTH>10)
    {
        if (client.connect(server, 80)) 
        {
            Serial.println("connccted");
            Serial.println(server);
            client.println("POST /localhost/test/test.php?REV=REV & LENGTH=LENGTH HTTP/1.1 "); 
            client.println("Host: 192.168.43.189"); 
            client.print(REV);
            client.print(LENGTH);

        }
        if (client.connected())
        { client.stop(); }

     
           REV=0;
      
    }
    else
    {
     
    }
}

Also, this is not right:

client.println("POST /localhost/test/test.php?REV=REV & LENGTH=LENGTH HTTP/1.1 ");

Try to look at what I wrote, carefully. Also you need some sort of logging from PHP. You can't just check it by going at "/test.php", cause it will still ask for that arguments.

I try this its work but stil l cant send the data that carry by variable

   if (client.connect(server, 80)) 
        {
            Serial.println("connccted");
            Serial.println(server);
            client.println("POST /localhost/test/test.php?REV=200 & LENGTH=100.30 HTTP/1.1 "); 
            client.println("Host: 192.168.43.189"); 
            client.print(REV);
            client.print(LENGTH);

        }
        if (client.connected())
        { client.stop(); }

then after that I tried this also and it show me invalid operands of type"constant char*'and 'constant char[10]'to binary operator+'

  if (client.connect("192.168.43.189", 80)) 
        {
            Serial.println("connected");
            //Serial.println(server);
            client.println("GET /test/test.php?rpm="+REV+"&Lengths="+Length"");

thanks Overflowz! after some modification on my code I solved the problem!

the code as below

    if (client.connect("192.168.43.189", 80)) 
        {
            Serial.println("connected");
            client.print("POST /test/test.php?");
            client.print("rpm=");
            client.print(REV);
            client.print("&Lengths=");
            client.print(Length);
            client.println("");
            client.println("  HTTP/1.1");
            client.stop();
        }
        else {
             // If Arduino can't connect to the server (your computer or web page)
            Serial.println("--> connection failed\n");
              }[code]

thanks for the help