To connect to a database you need to create a new MySQL class object.
See Creating a new MySQL object.