add example
This commit is contained in:
1 parent
6655d7ebfd
commit
7b97a5631d
1 file changed
+35
+35
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
require_once $_SERVER['DOCUMENT_ROOT'].'/core/bootstrap.php';
|
||||
|
||||
// DataBase class
|
||||
|
||||
// Query
|
||||
$result = $DataBase->query('SELECT * FROM iot_sensors WHERE ID=3924538');
|
||||
echo '<pre>'.print_r($result, true).'</pre>';
|
||||
|
||||
// Update
|
||||
$result = $DataBase->update('iot_sensors',
|
||||
array(
|
||||
'ID' => '3924538'
|
||||
),
|
||||
array(
|
||||
'VALUE' => '601',
|
||||
'SENSOR' => 'test_sensor2'
|
||||
)
|
||||
);
|
||||
echo '<pre>'.print_r($result, true).'</pre>';
|
||||
|
||||
|
||||
// Get items (sort ORDER BY VALUE DESC)
|
||||
$result = $DataBase->getItems('iot_sensors', array('VALUE'=>'>32'), array('VALUE'=>'DESC'));
|
||||
echo '<pre>'.print_r($result, true).'</pre>';
|
||||
|
||||
|
||||
// users class
|
||||
|
||||
$User->Authorize(1);
|
||||
|
||||
$result = $User->getFields(1);
|
||||
echo '<pre>'.print_r($result, true).'</pre>';
|
||||
|
||||
$User->Logout();
|
||||
Reference in new issue
Block a user