PHPWS_DB rewritten to use MDB2 and mysqli instead of mysql
change made to use mysql if mysqli is set
updated Sigma class