gamerx619 Posted March 22, 2008 Share Posted March 22, 2008 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 Quote Link to comment Share on other sites More sharing options...
Barand Posted March 22, 2008 Share Posted March 22, 2008 You might find the output from mysql_error() more useful than your offensive messages. Quote Link to comment Share on other sites More sharing options...
tibberous Posted March 22, 2008 Share Posted March 22, 2008 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? Quote Link to comment Share on other sites More sharing options...
gamerx619 Posted March 22, 2008 Author Share Posted March 22, 2008 yea the 10296_pamafia and sharethepain is the database login i meant soz. i dont no about cpanel but wot i used is phpmyadmin to setup the databases and all the tables with a script that it came with Quote Link to comment Share on other sites More sharing options...
gamerx619 Posted March 23, 2008 Author Share Posted March 23, 2008 You might find the output from mysql_error() more useful than your offensive messages. soz about that lolz my friend must of somehow slipped that in while i wasnt looking. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.