19 lines
728 B
PHP
19 lines
728 B
PHP
|
<?php
|
||
|
private $servidor = "192.168.0.10";
|
||
|
private $usuario = "usuario_pruebas";
|
||
|
private $bd = "pruebadb";
|
||
|
private $tabla = "tabla_prueba";
|
||
|
private $clave = "********";
|
||
|
private $fecha = $_POST["fecha"];
|
||
|
private $temperatura = $_POST["temp"];
|
||
|
private $humedad = $_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,$temperatura,$humedad);
|
||
|
$pst->execute();
|
||
|
$conexion->commit();
|
||
|
echo "<a href='index.html'>Datos Enviados, Volver</a>";
|
||
|
?>
|