diff --git a/Website Source Code/about.php b/Website Source Code/about.php index d78bb13..d2f9ff0 100644 --- a/Website Source Code/about.php +++ b/Website Source Code/about.php @@ -57,13 +57,13 @@
  • Location : Drap, France
  • Contact : contact@junkjumper-projects.com
  • -
  • PDF presentations pages (french only & only by downbloading) : +
  • PDF presentations pages (french only) :
  • @@ -91,4 +91,4 @@ - + \ No newline at end of file diff --git a/Website Source Code/auto.php b/Website Source Code/auto.php index 790b342..bfad479 100644 --- a/Website Source Code/auto.php +++ b/Website Source Code/auto.php @@ -1,13 +1,19 @@ setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + $conn1 = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); + // set the PDO error mode to exception + $conn1->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + $conn2 = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); + // set the PDO error mode to exception + $conn2->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Connection MySQL for imgs displaying. $bdd = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); @@ -28,9 +34,20 @@ try { $conn = null; +//Simulation of Arduino sensors reception +$randl = rand(0, 9999); +$randw = rand(0, 50); + +//send generated numbers to database +$sql1 = "UPDATE `capteurs` SET `lux` = '$randl' WHERE `capteurs`.`id` = 1"; +$stmt = $conn1->prepare($sql1); +$stmt->execute(); + +$sql2 = "UPDATE `capteurs` SET `vent` = '$randw' WHERE `capteurs`.`id` = 1"; +$stmt2 = $conn2->prepare($sql2); +$stmt2->execute(); ?> - @@ -47,7 +64,7 @@ $conn = null;
    @@ -80,15 +97,15 @@ $conn = null;