The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
how can i grab connection settings from config.php
im trying to get info from my config file and put it into a var for the script im trying to use
Code:
// Load the database settings into $VAR; function boardmodule_import_db_settings() { require_once ("../includes/config.php"); global $VAR; $VAR["db_host"] = "localhost; $VAR["db_username"] = "my database user for forum db"; $VAR["db_password"] = "my database password for forum db"; $VAR["db_name"] = "my database name for forum db"; $VAR["db_tblprefix"] = ""; $VAR["db_persistant"] = "0"; can i put like Code:
$VAR["db_name"] = $dbname; Code:
Notice: Undefined variable: dbname in /home/user/public_html/forum/to/my/script/dir/vb3.inc.php on line 34 (vb 3.6.1) |
#2
|
||||
|
||||
Try $config['Database']['dbname'] rather than $dbname.
|
#3
|
|||
|
|||
sweet thank you, it worked like a charm
Code:
// Load the database settings into $VAR; function boardmodule_import_db_settings() { require_once ("../includes/config.php"); global $VAR; $VAR["db_host"] = $config['MasterServer']['servername']; $VAR["db_username"] = $config['MasterServer']['username']; $VAR["db_password"] = $config['MasterServer']['password']; $VAR["db_name"] = $config['Database']['dbname']; $VAR["db_tblprefix"] = $config['Database']['tableprefix']; $VAR["db_persistant"] = $config['MasterServer']['usepconnect']; |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|