Jump to content

get my connect.php to work with the server


gamerx619

Recommended Posts

Hey i am new on phpfreaks and i was wondering if you people can help me ;)

I downloaded a text based mafia game package that runs on php and mysql. (www.gangsterlegends.com there i got it)

I managed to get a server that would work with it (my friend managed to get a mafia game working on the server i found),uploaded all the .php files ,ran a mysql script through phpMyAdmin successfully so it creates the tables. Now i have little/no experience in mysql.

The instructions tell me to edit the connect.php file. I am assuming by judging the file that it needs to know the mysql database before it can work properly as when i try to open my website it says "Can't connect to the MySQL server. Please contact the webmaster."

The only problem is, i dont no where to stick in the details corectly.

 

<?php

 

session_start();

ob_start();

 

$connect = mysql_connect("localhost","","");

if($connect == TRUE) {

if(mysql_select_db("") != TRUE) {

  exit("<span style='color: red'>Can't connect to the < snip > MySQL database. Please contact the webmaster.</body></html>");

}

}else{

exit("<span style='color: red'>Can't connect to the < snip > MySQL server. Please contact the webmaster.</body></html>");

}

?>

 

Deatils:

MYSQL user: 10296_pamafia

password: sharethepain

 

can anyone help me with this. Thanks ;D

 

 

The mysql connect function needs a host (localhost), a user name and a password. You need to find out the user name and password for your database, or find out the user name and reset the password, or make a new user name with a new password and set it to your database - do you have cpanel on your host?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.