PDA

View Full Version : get the ids from config.php


grreg
10-29-2010, 12:12 PM
Hello :)

I'm creating a plugin that should connect to an external database (not the main one).
I have added the connexion ids in includes/config.php : $config['Other_Database']['servername'], $config['Other_Database']['password'], and so on.

How can i get this values in the plugin php code ?
Thank you very much !

Lynne
10-29-2010, 01:43 PM
Probably want to use $vbulletin->config['Other_Database'']['servername'] but why not look to see how vb does it. Take a look into init.php

grreg
10-29-2010, 02:08 PM
thanks for the variable name :) that's what i was looking for

Take a look into init.php
You mean i should instanciate an other $db in this file, using the vB_Database class ?

Lynne
10-29-2010, 10:45 PM
I was simply saying you should look in the vbulletin files to see how they did it to get an idea of how you should do it (that is where I got the format for the variable name).