Am I entering the details correctly?

Hi,
This is a config file that I have for a script. I would appreciate your help in checking whether this correct. I have no experience in PHP whatsoever. Thank You Very Much

[php]<?php
// mySQL information
$server = ‘’; // MySql server
$username = ‘’; // MySql Username
$password = ‘’ ; // MySql Password
$database = ‘’; // MySql Database
//mySQL connect
$con = mysql_connect($server,$username,$password);
if(!$con) die('Could not connect: ’ . mysql_error());
if(!mysql_select_db($database, $con)) die('Could not select db: ’ . mysql_error());
$setting[‘site_path’] = dirname(FILE);
//Get settings
if (!isset($install)) {
$sql = mysql_query(“SELECT * FROM ws_settings”);
while ($get_setting = mysql_fetch_array($sql)) {
$setting[$get_setting[‘name’]] = $get_setting[‘value’];
}
}
?>[/php]

seems good, however i made some changes
it will work the same way
[php]<?php
// mySQL information
$server = ‘’; // MySql server
$username = ‘’; // MySql Username
$password = ‘’ ; // MySql Password
$database = ‘’; // MySql Database
//mySQL connect

$con = mysql_connect($server,$username,$password) or die(mysql_error());
mysql_select_db($database, $con) or die(mysql_error());

$setting[‘site_path’] = dirname(FILE);
//Get settings
if (!isset($install))
{
$sql = mysql_query(“SELECT * FROM ws_settings”);
while ($get_setting = mysql_fetch_array($sql))
{
$setting[$get_setting[‘name’]] = $get_setting[‘value’];
}
}
?>
[/php]

I got this error. Does this have anything to do with the code?
Parse error: syntax error, unexpected T_VARIABLE in /home/unique68/public_html/infinitegags/config.php on line 4

Could you provide me an example of a database with the details. With some random details.

Thank You For your Help

I assumed it wasnt working when you first posted to asking if you were doing it right.

now tell me what you want to do with this script

yeah it is supposed to work. I was having doubts whether I was inputting my database details correctly.
Is this how you put in the details
[php]<?php
// mySQL information
$server = ‘’;localhost
$username = ‘’;unique67_in
$password = ‘’ ;infiniteawesome
$database = ‘’;unique67_infinitegags
//mySQL connect
[/php]

Those arent actual details but similar. Is the above correct. That is all I want to know.

[php]

<?php // mySQL information $server = 'localhost'; $username = 'username'; $password = 'password' ; $database = 'database_name'; [/php]

YOU ARE THE MAN
YOU JUST SAVE THE DAY!!
THANKS A LOT!! ;D 8)

you are welcome

Sponsor our Newsletter | Privacy Policy | Terms of Service