Changed deprecated mysql to mysqli
Changed database configuration
Added tests