20 lines
631 B
PHP
20 lines
631 B
PHP
|
<?php
|
||
|
$servidor = "192.168.0.4";
|
||
|
$usuario = "esp01";
|
||
|
$bd = "pruebadb";
|
||
|
$tabla = "tabla_prueba";
|
||
|
$clave = "******";
|
||
|
$fecha = $_POST["fecha"];
|
||
|
$temp = $_POST["temp"];
|
||
|
$hum = $_POST["hum"];
|
||
|
|
||
|
$conexion = new mysqli($servidor, $usuario, $clave, $bd);
|
||
|
$conexion->begin_transaction();
|
||
|
$pst = $conexion->prepare("INSERT INTO tabla_prueba(Fecha_INO,Temperatura,Humedad) values(?,?,?)");
|
||
|
//bind_param recive i=enteros d=double o decimal s=cadena b=boolean
|
||
|
$pst->bind_param('sdi',$fecha,$temp,$hum);
|
||
|
$pst->execute();
|
||
|
$conexion->commit();
|
||
|
echo "<a href='index.html'>Datos Enviados, Volver</a>";
|
||
|
?>
|