Method: ConnectToDatabase
Parameters
host
The host to connect to (typically 'localhost')
username
The name of the MySQL user that will be used with this connection
password
The given user's password
database
The name of the MySQL database A Wee Tiny Blog is to use
Description
In order to work, each A Wee Tiny Blog object needs to be able to access the MySQL database that contains the table with the blog entries. This method is the usual way of setting up that connection, and it only needs to be called once per script.
Alternatively, you can create the handle to your MySQL database using PHP's
mysqli_connect and
mysqli_select_db functions. Pass the handle returned by
mysqli_connect to A Wee Tiny Blog's
UseConnection method to connect the object to the database.
Return values
If the connection is successful, this function returns TRUE.
Otherwise, it returns FALSE and sets the internal error flag. Call
GetLastError for more details about the error.