-
Notifications
You must be signed in to change notification settings - Fork 1
/
arduino_sqlserver.php
31 lines (23 loc) · 1 KB
/
arduino_sqlserver.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
// on load registra el movimiento de un bien en un determinado sensor para mapear el tracking a futuro.
# return $this->render('ArduinoBundle:Default:index.html.twig');
$usuario = "administrator";
$pass = "administrator";
$servidor ="utn.c0gs5ej8mv5r.us-west-2.rds.amazonaws.com,1433";
$bdd = "patrimonioUTN2";
$info = array('Database'=>$bdd,'UID'=>$usuario,'PWD'=>$pass);
$conexion = sqlsrv_connect($servidor,$info);
if( $conexion ) {
$parametros['id_sensor'] = 1;
$parametros['id_inventario'] = $_GET["rfid"];
$procedure_params = array(
array(&$parametros['id_sensor']),
array(&$parametros['id_inventario'])
);
$sql = "EXEC SP_NUEVO_MOVIMIENTO @id_sensor = ?, @id_inventario = ?";
$stmt = sqlsrv_prepare($conexion,$sql,$procedure_params);
$res = sqlsrv_execute($stmt);
}else{
}
sqlsrv_close($conexion);
?>