Connecting to database

I have created a script and to connect to the datebase I have this code

// replace 'xxxxxxxx' with your database name, username, and password for music.
$dbhost    = 'Localhost';
$dbname    = 'xxxxxxxxx';
$dbuser    = 'xxxxxxxxx';
$dbpasswd  = 'xxxxxxxxx';
// adjust the URL to yours
$url       = 'http://mysitedomain.com/';


$id        = (isset($_GET['groups'])) ? strval($_GET['groups']) : 15;

// connect to database
$dbcnx     = mysql_connect($dbhost, $dbuser, $dbpasswd) or die("Could not connect to host: " . $dbhost);
$dbselect  = mysql_select_db($dbname) or die("Could not connect to database: " . $dbselect);

if ((!$dbcnx) || (!$dbselect))
{
echo "Can't connect to database";
}

I dont want to include this information on the page every time I create script can someone tell me what I can replace it with.

Cheer

Quote · 26 May 2009

look at join.php it shows you some db_res() functions you can use..found in inc/db.inc.php

db inc is there use it

try those

I have video tutorials to help you mrpowless.com
Quote · 26 May 2009

look at join.php it shows you some db_res() functions you can use..found in inc/db.inc.php

db inc is there use it

try those

Cheers... I take a look... hey you dont have one of your video's on this do?Laughing

Quote · 26 May 2009

Way over my head.... Iwas hoping that it might have been as simple as adding

require_once( './inc/header.inc.php' ); instead.

would it help if I put the full script here?

Quote · 26 May 2009
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.