[joomla][tip] DB connection in non joomla pages

22 Mar

While using ajax based dropdowns, I required a db connection in php page (non joomla page). I did it as follows:

include(“../../../../configuration.php”); //adjust the path of configuration.php
$config = new JConfig();
$con = mysql_connect($config->host,$config->user,$config->password);

And Thats it 🙂

Same goes with almost every cms and framework.

Leave a comment

Posted by on March 22, 2012 in joomla


Tags: , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: