• Resolved sophistikat

    (@sophistikat)


    how do you access the variables from wp-config.php?

    i don’t want to write;

    $db = mysql_connect($DB_HOST, $DB_USER, $DB_PASSWORD) or die(‘Could not connect: ‘ . mysql_error());
    mysql_select_db($DB_NAME) or die(‘Could not select database’);

    I need to connect multiple times and don’t want to write the information multiple times because once it goes live it will change.

Viewing 1 replies (of 1 total)
  • Thread Starter sophistikat

    (@sophistikat)

    just for sh** and giggles, i removed the dollar sign and it works:

    $db = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
    mysql_select_db(DB_NAME);
Viewing 1 replies (of 1 total)

The topic ‘reconnect with wp-config.php’ is closed to new replies.