title: Transfer RFID tag no. to mysql
body: <p>I am having tough time to transfer my RFID tag no. to mysql database. When I compile the given code server gets connected so and prints the rfid no. and also says data sent to server but when I open my php file (also mysql) there is no data stored. What am I doing wrong!! P.s sorry for my bad english.   </p>
  
  <pre><code>#include &lt;Ethernet.h&gt;
  #include &lt;SPI.h&gt;
  #include &lt;Client.h&gt;
  #include&lt;SoftwareSerial.h&gt;
  SoftwareSerial RFID(2,3);
  int i;
  int rfid;
  char newtag[14];// = {2,49,51,48,48,57,69,66,48,51,57,48,52,3};
  byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
  byte subnet[] = {255,255,255,0};
  //IPAddress gateway(192,168,1,1);
  //IPAddress DBserver(192, 168, 1, 2);
  IPAddress server(192,168,1,7);
  //char server[] = "localhost/te";
  IPAddress ip(192,168,1,2);
  EthernetClient client;
  void setup()
  {
      Serial.begin(9600);
      RFID.begin(9600);
      delay (1000);
      Serial.print("*********Initializing Ethernet*********n");
      if (Ethernet.begin(mac) == 0)
      {
          Serial.println("Failed to configure Ethernet using DHCP");
          Ethernet.begin(mac, ip);
      }
      //Ethernet.begin(mac, server, gateway);
      delay(1000);
      Serial.println("connecting...");
      Serial.print("IP Address:");
      Serial.println(Ethernet.localIP());
      Serial.print("Subnet Mask:");
      Serial.println(Ethernet.subnetMask());
      Serial.print("Default Gateway IP:");
      Serial.println(Ethernet.gatewayIP());
      Serial.print("DNS Server IP:");
      Serial.println(Ethernet.dnsServerIP());
  }
  void loop()
  {
      // while(1)
      {
          if (client.connect(server, 80))
          {
              Serial.print("Connected to server:");
              Serial.println(Ethernet.dnsServerIP());
              while(1)
              {
                  if (RFID.available() &gt; 0)
                  {
                      Serial.println("reading rfid tags");
                      delay(100);
                      for (i=0; i &lt; 14; i++)
                      {
                          rfid = RFID.read();
                          newtag[i]=rfid;
                      }
                      RFID.flush();
                      Serial.print("rfid tag no:");
                      Serial.print(newtag);
                      Serial.println("Sending to Server...");
                      client.println("GET 192.168.1.7/te/add_data.php?sensor=2323 HTTP/1.1");
                      client.print(newtag);
                      client.println(" HTTP/1.1");
                      client.println("Host: 192.168.1.7/te/");
                      client.println("User-Agent: Arduino");
                      client.println("Accept: text/html");
                      Serial.println("data sent to server");
                  }
              }
          }
          else
          {
              Serial.println("Cannot connect to Server");
          }
      }
  </code></pre>
  
  <p>and my php code is</p>
  
  <pre><code>&lt;?php
      // Start MySQL Connection   
      include('dbconnect.php'); 
  ?&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt; Log&lt;/title&gt;    
      &lt;style type="text/css"&gt;    
          .table_titles, .table_cells_odd, .table_cells_even {    
                  padding-right: 20px;    
                  padding-left: 20px;    
                  color: #000;    
          }    
          .table_titles {    
              color: #FFF;    
              background-color: #666;    
          }    
          .table_cells_odd {    
              background-color: #CCC;    
          }    
          .table_cells_even {    
              background-color: #FAFAFA;    
          }    
          table {    
              border: 2px solid #333;    
          }    
          body { font-family: "Trebuchet MS", Arial; }    
      &lt;/style&gt;    
  &lt;/head&gt;    
      &lt;body&gt;    
          &lt;h1&gt;Arduino  Log&lt;/h1&gt;    
      &lt;table border="0" cellspacing="0" cellpadding="4"&gt;    
        &lt;tr&gt;
             &lt;td class="table_titles"&gt;ID&lt;/td&gt;    
              &lt;td class="table_titles"&gt;Date and Time&lt;/td&gt;
              &lt;td class="table_titles"&gt;RFID tag&lt;/td&gt;
        &lt;/tr&gt;
  &lt;?php    
      // Retrieve all records and display them
      $result = mysql_query("SELECT * FROM FYP ORDER BY id ASC");
      // Used for row color toggle
      $oddrow = true;
      // process every record
      while( $row = mysql_fetch_array($result) )
      {
          if ($oddrow) 
          { 
              $css_class=' class="table_cells_odd"'; 
          }
          else
          { 
              $css_class=' class="table_cells_even"';
  
          }
          $oddrow = !$oddrow;
          echo '&lt;tr&gt;';
          echo '   &lt;td'.$css_class.'&gt;'.$row["id"].'&lt;/td&gt;';
          echo '   &lt;td'.$css_class.'&gt;'.$row["event"].'&lt;/td&gt;';
          echo '   &lt;td'.$css_class.'&gt;'.$row["tag"].'&lt;/td&gt;';
          echo '&lt;/tr&gt;';
      }
  ?&gt;
      &lt;/table&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>