Added code in c for database