--- /dev/null
+TODO
+ - Add timings to graphs
+ - Add charts of other info
\ No newline at end of file
"attribute VARCHAR(128), name VARCHAR(128), ".
"graph integer, maximum integer, minimum integer, ".
"duration integer, primary key (host, attribute));";
- $db->query($query);
+ if( ! $db->query($query) )
+ {
+ print_r($db->errorInfo);
+ die();
+ }
$result = $db->query("SELECT * FROM bdsmweb;");
}
+if( !$result )
+{
+ echo "Error selecting table bdsmweb<br/>";
+ print_r($db->errorInfo());
+ die();
+}
+
if( isset($_POST) )
{
foreach( array_keys($_POST) as $key )
foreach($attributes as $attribute)
{
$result = $db->query("SELECT * FROM bdsmweb WHERE host='$host' AND attribute='$attribute'");
- $values = $result->fetch();
+ if( $result )
+ $values = $result->fetch();
+ else
+ $values = Array();
+
echo " <tr>";
echo " <td>$attribute</td>";
echo " <td><input type='text' name='$host|$attribute|name' value='".$values['name']."' /></td>";
context.lineWidth = 2;
<?php
$result = $db->query("SELECT attribute, name FROM bdsmweb WHERE host='$host' AND graph=1;");
- if( !$result )
+ if( ! $result )
{
- echo "Error: No measurements found in database file /home/bdsm/etc/bdsm/bdsm.db for host $host";
+ echo "</script><br/>";
+ echo "Error: No configuration found in database file /home/bdsm/etc/bdsm/bdsm.db for host $host<br/>";
echo "Query: SELECT attribute, name FROM bdsmweb WHERE host='$host' AND graph=1;";
+ die();
}
$attributes = Array();