C Language: Database Lookup