PDA

View Full Version : Need Some Basic Help



VirtualG
26-03-2010, 08:51 AM
<?
$host = "localhost";
$dbuser = "db_username";
$dbpwd = "db_password";
$db = "db_name";
$connect = mysql_pconnect($host, $dbuser, $dbpwd);
if(!$connect) {
echo("Could not connect to database...");
} else {
$select = mysql_select_db($db);
}
?>

Yeh, thats the config.php file from HabboSoft usersystem, can anyone tell me how to config it and what goes where? I've made a database, put a username and pass with it, I've obv entered all that into my file. (it's not working though because...) But what am I supposed to do with the localhost, leave it? Enter something else? If I enter something else, what? How do I find it? etc... Thanks and +rep to any whole helps!

ThisNameWillDo!
26-03-2010, 10:40 AM
Yeh, thats the config.php file from HabboSoft usersystem, can anyone tell me how to config it and what goes where? I've made a database, put a username and pass with it, I've obv entered all that into my file. (it's not working though because...) But what am I supposed to do with the localhost, leave it? Enter something else? If I enter something else, what? How do I find it? etc... Thanks and +rep to any whole helps![/FONT][/COLOR]

<?
$host = "localhost";
$dbuser = "YOUR DATABASE USERNAME";
$dbpwd = "YOUR DATABASE PASSWORD";
$db = "YOUR DATABASE NAME";
$connect = mysql_pconnect($host, $dbuser, $dbpwd);
if(!$connect) {
echo("Could not connect to database...");
} else {
$select = mysql_select_db($db);
}
?>

Leave localhost as it is, just put your database username, password and name in. Make sure you have given the user full permissions in the database and also make sure you're putting the right database username, name and password in. For example, my username could be test for my cpanel and my database username could be user so the database username would be test_user. Also, if my database was named data, my database name would be test_data.

Kind Regards,
Vince.

VirtualG
26-03-2010, 10:57 PM
Thanks, +rep A lot more helpful than clubhabbo!

Blinger1
26-03-2010, 11:41 PM
http://www.tizag.com/mysqlTutorial/ for more tutorials about mysql btw

Want to hide these adverts? Register an account for free!