Database bug fixed and demo.php changed