29 lines
1.0 KiB
PHP
29 lines
1.0 KiB
PHP
|
<?php
|
||
|
$servidor = "192.168.0.10";
|
||
|
$usuario = "esp1";
|
||
|
$bd = "pruebadb";
|
||
|
$tabla = "GARDENER";
|
||
|
$clave = "*******";
|
||
|
$id = $_POST["id"];
|
||
|
$fecha = $_POST["fecha"];
|
||
|
$hum1 = $_POST["hum1"];
|
||
|
$hum2 = $_POST["hum2"];
|
||
|
$hum3 = $_POST["hum3"];
|
||
|
$hum4 = $_POST["hum4"];
|
||
|
$tempsup = $_POST["tempsup"];
|
||
|
$humsup = $_POST["humsup"];
|
||
|
$tempinf = $_POST["tempinf"];
|
||
|
$huminf = $_POST["huminf"];
|
||
|
$tempext = $_POST["tempext"];
|
||
|
$humext = $_POST["humext"];
|
||
|
|
||
|
$conexion = new mysqli($servidor, $usuario, $clave, $bd);
|
||
|
$conexion->begin_transaction();
|
||
|
$pst = $conexion->prepare("INSERT INTO GARDENER(id,fechaBG,hum1,hum2,hum3,hum4,tempsup,humsup,tempinf,huminf,tempext,humext) values(?,?,?,?,?,?,?,?,?,?,?,?)");
|
||
|
//bind_param recive i=enteros d=double o decimal s=cadena b=boolean
|
||
|
$pst->bind_param('isiiiidididi',$id,$fecha,$hum1,$hum2,$hum3,$hum4,$tempsup,$humsup,$tempinf,$huminf,$tempext,$humext);
|
||
|
$pst->execute();
|
||
|
$conexion->commit();
|
||
|
|
||
|
echo "<a href='index.html'>Datos Enviados, Volver</a>";
|
||
|
?>
|