Hi,
Well I don't think it's in the scope of this forum to give you a "Session 101" here. I really suggest you to first go to:
http://www.phpbuilder.com/columns/
And read and try examples given there like Mattias Nilsson's articles
http://www.phpbuilder.com/columns/mattias20000105.php3
And it's follow up:
http://www.phpbuilder.com/columns/mattias20000312.php3
You'll find many interesting columns written there. In my humble opinion it's not fair to the creators of phpbuilder to ignore their great columns which answer much of what you are asking.
Also, I've been reading this forum for about half a year now and your question involving sessions and securing your page have been asked, and clearly answered, dozen of times already.
A proper search should also give you much information.
You are trying to connect people who visit your page to your own MySQL database and think this authorizes them?
You need to create a table with fields like id, login, password, possible user level. And query that.
I wouldn't know where to begin to make this all clear to you, and I don't have time for that also.
People reading this forum gladly help you to comment you on syntax, tell you where it's wrong offer you alternatives or even show you short examples of how to do this.
What you are asking however, is a bit beyond that.