RSS

[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);
mysql_select_db($config->db,$con);

And Thats it 🙂

Same goes with almost every cms and framework.

Advertisements
 
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:

WordPress.com Logo

You are commenting using your WordPress.com 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: