A Wee Tiny Blog

Home || Downloads || Documentation || Change Log || License || Roadmap || Contact


Method: ConnectToDatabase


The host to connect to (typically 'localhost')
The name of the MySQL user that will be used with this connection
The given user's password
The name of the MySQL database A Wee Tiny Blog is to use


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.


Hosting generously provided by
Get A Wee Tiny Blog at SourceForge.net. Fast, secure and Free Open Source software downloads