The MU forums have moved to WordPress.org

Accessing database and config/stats/etc. (3 posts)

  1. StianH
    Member
    Posted 17 years ago #

    Greetings,

    I am working on a little addon for my WPMU, it lies in it's own file on the root of the install, and I would like to use the standard way of connecting to the database, instead of having my own mysql_connect, and so on, and I would like to grab stuff from the wp_blogs table. The reason I want to do this is of course that it will be just a drop-in addon that you won't have to configure.

    Any suggestions?

  2. drmike
    Member
    Posted 17 years ago #

    Um, last time I knew, the standard way of connecting to a MySQL database is via mysql_connect or mysql_queue.

    Unless you know some alien method of mysql that I don't know about...

  3. StianH
    Member
    Posted 17 years ago #

    OK, I'm sorry, let me re-phrase.

    How can I utilizie the database settings, and the built in functions from WordPress MU?

    When viewing wp-rss2.php, there is no "mysql_connect" and so on, only a require for wp-config.php, which enables the page to use functions and through them access the database.

    Can I also require wp-config.php, and instantly have access to it all?

About this Topic