...

View Full Version : Hoping you dudes know what connect.php is =0



2Pacalypse
07-17-2008, 11:20 PM
I downloaded a script for a game...

This is my connect.php file.


<?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>");
}
?>

I'm using a free host called 110mb for a while to test it out and make sure it runs smooth.
PHP Ver: 5.1.6
MySQL Ver: 5.0.27

Any help is appreciated!

Try to keep it simple! I am complete noob to this coding!

kbluhm
07-17-2008, 11:29 PM
What's the question?

2Pacalypse
07-17-2008, 11:31 PM
Question is what do I do to finish the code :)

Sorry I diddn't type that in original message :(

rafiki
07-17-2008, 11:33 PM
Thats all a connect.php file really needs.

2Pacalypse
07-17-2008, 11:42 PM
But on the line where it says:
$connect = mysql_connect("*localhost","","")

Don't you need something between to other double quote things (")? :confused:

kbluhm
07-17-2008, 11:45 PM
http://www.php.net/mysql
http://www.php.net/mysql_connect
http://www.php.net/mysql_select_db

rafiki
07-17-2008, 11:46 PM
Yes first set of double quotes is for username to the mysql database e.g.
mysql_connect("localhost", "2Pacalypse", "");
Third set is for your password e.g.

mysql_connect("localhost", "2Pacalypse", "Rafiki");

Or read above

2Pacalypse
07-17-2008, 11:53 PM
Oh, thank you!

110mb doesn't offer them databases on a free subscription :(

Thanks...
I was trying to put in my login details for my 110mb account :rolleyes:

Thanks to all :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum