table = $table;
$this->conn = mysqli_connect($DBServerName, $DBUserName, $DBPassword, $DBName);
}
public function save_data($coil, $fan){
// Save new commmands to the table.
$sql = "UPDATE `$this->table` SET `coil`='$coil', `fan`='$fan' WHERE id=1";
if(mysqli_query($this->conn, $sql)){ echo "SAVED!
Coil => ".$coil."
Fan => ".$fan; }else{ echo 'ERROR!'; }
}
public function print_data(){
// Print the current command variables.
$sql = "SELECT * FROM `$this->table` WHERE id=1";
$result = mysqli_query($this->conn, $sql);
while($rows = mysqli_fetch_assoc($result)){
echo '%'.$rows['coil'].'%'.$rows['fan'].'%';
}
}
}
?>