RuleXas Posted February 28, 2010 Posted February 28, 2010 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>"); } ?> Quote
Redex Posted February 28, 2010 Posted February 28, 2010 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 Quote
Taxed Posted February 28, 2010 Posted February 28, 2010 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. Quote
Redex Posted February 28, 2010 Posted February 28, 2010 Atleast i was on the right track :). Meh atleast my post helped. Quote
Guest Null Posted March 4, 2010 Posted March 4, 2010 @taxed: I believe he edited out the details so noone would try to connect to his database and mess with it. Quote
Djkanna Posted March 4, 2010 Posted March 4, 2010 <?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. Quote
Taxed Posted March 4, 2010 Posted March 4, 2010 @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. Quote
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.