If you are new to this field, I recommend you to read a PHP & MySQL book (For dummies is a good collection) or buy on online tutorial. Here are the steps you need to learn:
1- Basic PHP code
2- Learn the SQL operations (select, insert, update, delete)
3- Learn how to integrate PHP and MySQL
And consider this: to access a mysql database you use a php database extension such as mysql, mysqli or PDO. If you are starting to learn please do not use the oldest mysql extension since it is being phased out. It is OK if you use newer mysqli extension but in my opinion PDO is the best option.
I am posting this just to give you some guidance before you start to learn how to access databases. There are still so many programmers that use the old and deprecated mysql since no-one told them what is the right thing to use.
If you're in one of those predicaments where cls.__private attributes just aren't enough since they can easily be accessed through inst._cls__private, and you need something a little more secure, here's ...