

$dbuser = "database username";
$dbpass = "database password";
$dbname = "database name";
$dbhost = "localhost";
mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db($dbname) or die("Unable to select database");
-RJ- said:Edit your config.php file and replace the values for database name, database username and password with the correct settings for your database. Those settings are provided to you by your webhost, or setup by you through your web hosting control panel.
For example, code used with PHP to connect to a MySQL database:
PHP:$dbuser = "database username"; $dbpass = "database password"; $dbname = "database name"; $dbhost = "localhost"; mysql_connect($dbhost,$dbuser,$dbpass); mysql_select_db($dbname) or die("Unable to select database");
Replace the values for the first three lines with the correct settings for your database.
Tjobbe said:whats wrong?
how do i set the mysql data base/\?
connecting to the database usually is by enterring your username followed by the db name/ db username:
such as:
username_dbname
username_dbusername
password
if your ftp username is "sitename" and your database is called "frogs", your db username and password are "tanks" and "bangers" resoectively, then it would look like this:
sitename_frogs
sitename_tanks
bangers
hope this helps!
