You must always connect both input terminals of an opamp to thought-out and considered points. What you connect them to determines what function the opamp will provide.
If you connect +ve to a ground, and -ve via a feedback impedance to the output terminal, you create a 'transimepdance amplifier'. Any current you now push into the -ve input must also be balanced by a current from the output terminal through the impedance. Use a feedback resistor to convert current to volts. Use a feedback capacitor to create an integrator. The gain will be inverting.
If you connect your input voltage to +ve, and the -ve to a fraction of the output voltage (create a fraction with a voltage divider to ground, usually resistors, but you could use other impedances or even a transformer), you create a non-inverting amplifier, where the gain is the reciprocal of the feedback voltage divider.
You can do more complicated things as well, but the two above are the basics.