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

 

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.