Forums

reconnect with wp-config.php (2 posts)

  1. sophistikat
    Member
    Posted 4 years ago #

    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.

  2. sophistikat
    Member
    Posted 4 years ago #

    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);

Topic Closed

This topic has been closed to new replies.

About this Topic