Iphone password not working

So I was playing around with settings on my Iphone, and while trying to access main security settings where I have to put in my code (4 digit) it said I was wrong. So I locked phone and tried to go back in and now it won't let me back in! I'm either losing my mind, or for some reason my Iphone (4) is malfunctioning. Has this ever happened to anyone? I googled this, but can only find the solution of reset/restoring an Iphone which wipes all your data. Not something I want to do. What should I do? Wait till morning and call Apple? Or is there another, more immediate solution to this problem. Please help! Why would my phone do this?

Added (1). I work in a business where my contacts are absolutely imperative to conducting business. I can't erase my data. Would Apple be able to open the phone without a restore?

And secondly, I never reset the password. Why would this happen? Am I paranoid to think someone could have hacked or something remotely to reset this? Totally bizarre…

Added (2). Nevermind. The thing just erased itself. Trying to restore from ICloud… I guess my question now is WHY did this happen. Freaks me out. Just a malfunction or something/someone tampering with my phone?

Hook it up to itunes on a computer. You should be able to reset it there

Unfortunately the only way to unlock your iPhone is to restore it. However, depending on how much info there was on your phone, it would take a maximum of 2-3 hours for you phone to be back to normal. As for why you phone is locked, you may have accidentally pressed the wrong code.

Reset your i phone data, and if you have important data in there, then you areeee fakkeddddd

Call apple

Reset the password.