Jump to content
MakeWebGames

How to edit connect.php file?


RuleXas

Recommended Posts

hi all how to edit connect.php file?

thats is a code:

<?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 MySQL database. Please contact the webmaster.</body></html>");
}
}else{
exit("<span style='color: red'>Can't connect to the MySQL server. Please contact the webmaster.</body></html>");
}
?>
Link to comment
Share on other sites

Meh i'm not a coder but i think it would be something to do with this line:

 

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

 

Probably around them speech marks. I've not had experience with engines, or in particular this engine but i would assume that the db name and password have to go there.

Hope this helps - Redex

Link to comment
Share on other sites

session_start();
ob_start();

$connect = mysql_connect("localhost","<DATABASE USERNAME>","<DATABASE PASSWORD>");
if($connect == TRUE) {
if(mysql_select_db("<DATABASE NAME>") != TRUE) {
 exit("Can't connect to the MySQL database. Please contact the webmaster.");
}
}else{
exit("Can't connect to the MySQL server. Please contact the webmaster.");
}
?>
If you dont add in the nessisary database details the scripts cannot conenct to the rightMYSQL database and thus will continuely fail to connect.
Link to comment
Share on other sites

<?php
$connect = mysql_pconnect('localhost', 'username', 'pass') or trigger_error("<span style='color: red;'>Can't connect to the MySQL database. Please contact the webmaster.</span>");
mysql_select_db('DatabaseName', $connect) or trigger_error("<span style='color: red;'>Can't connect to the MySQL server. Please contact the webmaster.</span>");
?>

One config file.

Link to comment
Share on other sites

@taxed: I believe he edited out the details so noone would try to connect to his database and mess with it.
So what your suggesting is that he removed the details then made a post asking how to setup the config? That makes no sense. The script is in working order, only the details missing.
Link to comment
Share on other sites

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.   Paste as plain text instead

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