Arduino yun Joomla SQL communications.

values from and to 32u

// Istwertausgabe means actuall values on arduino

  istwerte = "";
  for(int i = 1; i <=9; i++)
  {
     istwerte = istwerte + String(map(Regelwert[i],0,254,0,100))+ "#";
  }


  if (last_istwerte != istwerte)
  {
    last_istwerte = istwerte;
    Bridge.put("istwerte",istwerte);
    delay(50);
 }

php yun side

<?php
include ("bridgeclient.class.php");
$client = new bridgeclient();


$IstwerteBridge = $client->get("istwerte");
$Istwert = explode("#", $IstwerteBridge);

for ($i = 0; $i <= 8; $i++) {
        if ($Istwert[$i] > 100)
        goto Ende;
}

i do some test:

No installation of mysql on arduino but only a php page recall:

Arduino code:

// temp to SQL

#include <Bridge.h>
#include <HttpClient.h>
#include <Process.h>
Process date;
float temperatura = 0.00 ;
int umidita = 0;




void setup() {
 
  
 
  
  pinMode(13, OUTPUT);
  digitalWrite(13, LOW);
  Bridge.begin();
  digitalWrite(13, HIGH);
  if (!date.running())  {
      date.begin("date");
      date.addParameter("+%T");
      date.run();
    }
     Serial.begin(9600);

  while (!Serial); // wait for a serial connection

    delay (1000);
  
   digitalWrite(13, LOW);

 
}

void loop() {
   digitalWrite(13, LOW);
  
  temperatura = ((A0 * 0.0032) - 0.5) / 0.01;
  int dummy1 = (int) temperatura; 
  String temp =  String((dummy1), DEC);
  int randNumber = random(99);
 
 
  // Initialize the client library
  HttpClient client;



 

 //********************

 // metto a posto la data e l'ora
String ora = getora(); //ora
 String dummy = getdata();
 String anno = dummy.substring(6, 8); // 
 String data = dummy.substring(0,5); // data
 anno = "20" + anno + "-"; // metto a posto l'anno
 data.replace("/","-"); 
 data = anno + data;
 
 data += "%20" + ora;
 data.trim();
 //**********1*************
 

 
 client.get("http://www.ilchetto.it/inserisci.php?tempo="+ data +"&temperatura="+ temp + "&umidita="+ randNumber);
 //client.get("http://www.ilchetto.it/inserisci.php?temperatura="+ temp + "&umidita="+ randNumber);
String risp;
 while (client.available()) {
    char c = client.read();
    risp += c;
    }
    risp.trim();
    
if (risp == "dati inseriti"){
 digitalWrite(13, HIGH);
}
Serial.println(risp);
risp = "";
// digitalWrite(13, HIGH);
  delay(10000);
}

String getora(){
  Process date;
  date.begin("date");
  date.addParameter("+%T");
  date.run();
  if (date.available()) {
    String timeString = date.readString();    
    return timeString;
  }
 date.close(); 
}
String getdata(){
  Process date;
  date.begin("date");
  date.addParameter("+%D");
  date.run();
  if (date.available()) {
    String timeString = date.readString();    
    return timeString;
  }
 date.close(); 
}

php code:

<?php


	include("configurazione.php");
	
	

	if(@$_REQUEST['temperatura']!="")
	{
	
        $tempo=mysql_real_escape_string($_REQUEST['tempo']);
		$temperatura=mysql_real_escape_string($_REQUEST['temperatura']);
		$umidita=mysql_real_escape_string($_REQUEST['umidita']);
		
		
		mysql_query("INSERT INTO `temperatura`(`ID`, `time`, `temperatura`, `umidita`) VALUES (\"\",'$tempo', $temperatura,$umidita);");
	
	echo "dati inseriti";
	
	}
	else
	{
	echo "errore";
	
	die();
	}
	
?>