How can I connect to the database using the wp-config.php file ?
I'm trying to make a script more Wordpress friendly, and I need to connect to the database, but without installing the script as a plugin.
Basically I have on my script
$host = "xxxxxxxxxxx"; //database location $user = "xxxxxxxxxxx"; //database username $pass = "xxxxxxxxxxx"; //database password $db_name = "xxxxxxxx"; //database name //Database Connection $link = mysql_connect($host, $user, $pass); mysql_select_db($db_name);
The script can not be installed as a plugin (which can make things more easy), so I need to connect to the database using the existing wp-config.php on the installation... Any ideas ???
Thanks in advance
Edit and Clarification
1- I need to use wp-config.php as it is, no modifications. 2- The script will be located at www.example.com/script/ 3- It can't be done as a plugin since the core of the script require to be publicly accessed without any login screen jumping around. 4- My question basically is how to connect to the database using the wp-config.php file by modifying the script above.