Changed to mysqli and debugged - changed field names