• ok I have a simple yet frustrating problem.

    I am currently coding a script which i want to do the following in:
    – Loop through an array of wp config files
    – Include the currently selected file
    – Do stuff
    – CLOSE THE SELECTED FILE/CONNECTION
    – Continue

    My code is perfect and fine, the wordpress being included isn’t.

    When I include the first one in the array, it will connect fine and do the “stuff” i specify. But when it gets to the second array entry, it includes the file but continues to use the first file’s connection.

    I tried mysql_close and even unsetting $wpdb but no luck, wordpress just doesn’t want to be closed.

    Its so simple yet WP makes it so complex and irritating.

    If anyone can answer this I will be very greatful.

    Thanks
    J

Viewing 5 replies - 1 through 5 (of 5 total)
  • dont close wordpress’ db connection.

    use the new_link parameter when opening the second db connection.

    https://us.php.net/function.mysql-connect

    Thread Starter 818681

    well I can’t because im simply including the wordpress’ config file.

    It works perfect until it tries including another file.

    well youre going to have to elaborate on what you are trying to do. What you describe above isnt enough.

    Thread Starter 818681

    ok

    I have a custom script, I include wp-config.php INTO that script (include “wp-config.php”) but from an array.

    e.g.

    $array = array(“wp-config.php”,”anotherwp-config.php”);
    foreach($array as $value) {
    include $value;
    // Do stuff
    // somehow close the current wordpress connection
    }

    But as it is now, when the second config is included, the first connection is still used, not the second.

    dunno cant help you, and dont understand why you are including configuration files like that. But whatever..

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WordPress Inclusion’ is closed to new replies.