The MU forums have moved to

About $wpdb (3 posts)

  1. YoBazil
    Posted 16 years ago #

    Well i have installed WordPress MU, using Apache2, PHP 5.2
    my site developed with php5.2 and symphony.
    I have set the WordPress at the root directory of my site web directory inder blogs/
    this is working fine, i can see blogs, and create new one.
    When i try to call the blog login page from my symfuny project, i get error.
    i have puten all the wordpress code from the installation in my \frontend\modules\user\templates and call wp-loginSuccess from my action.
    the problem i have is that the $wpdb gets error when trying to call it -
    Call to a member function get_var() on a non-object

    for some reason this global db connection is not initiated,
    someone knows where this initiation takes place? and way it is not working?

    maybe because at initiating the wordpress DB i specified the directory of : web\blogs
    and now i moved all the code to my module at :

    could someone help please.

  2. PhoenixRises
    Posted 16 years ago #

    Including ~/wp-includes/wpdb.php (where ~ is the root directory of WordPress) should give you the initialized variable, $wbdb, then declare the global in any functions that need it.

    Having not used symfony, if that doesn't help, posting the problem code might help in solving the issue.

  3. bradmkjr
    Posted 16 years ago #

    something like this may be in order:


    if (empty($wp)) {

About this Topic

  • Started 16 years ago by YoBazil
  • Latest reply from bradmkjr