100 Web Space
http://forum.100webspace.com/

PHP Script trouble!!
http://forum.100webspace.com/viewtopic.php?f=5&t=10049
Page 1 of 1

Author:  Daniella Ivette [ Thu Jun 05, 2008 11:00 am ]
Post subject:  PHP Script trouble!!

I'm using a PHP Fanlisting management script, (Flinx), but I have trouble with my config file...

Code:
// Information needed to connect to mySQL
$dbhost = "localhost"; // usually this is localhost but if it doesn't work, check with your hosting provider
$dbname = "name"; // the name of the database you want to use
$dbuser = "name"; // your mySQL username (must have access to the database above!)
$dbpass = ""; // your mySQL password

// Choose a password to access admin.php
$admin_password = "";

// Absolute path to the folder where buttons will be uploaded - remember the trailing slash!
$MOVE_TO_PATH = "codes/";

// The URL to the folder above - remember the trailing slash!
$base_url = "danielucha.cogia.net/fanlists/codes/";

// Choose the target of your links, ie. _blank for a new window, _self for the same window
$target = "_blank";

// The names of the tables you wish to create for the categories and links (doesn't need to be changed)
$table_cat = "fanlist_cat";
$table_link = "fanlist_link";

// If you want to change the look of script, open up the header.inc and footer.inc that are included in the zip file, and follow the instructions there.

$db = @mysql_connect("$dbhost","$dbuser","$dbpass");
mysql_select_db("$dbname") or die( "Unable to select database. Are you sure the information in config.php is correct?");

?>


When I try to use it, this is what happens:

Quote:
Warning: mysql_select_db(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/www/danielucha.cogia.net/fanlists/config.php on line 30

Warning: mysql_select_db(): A link to the server could not be established in /home/www/danielucha.cogia.net/fanlists/config.php on line 30
Unable to select database. Are you sure the information in config.php is correct?


Am I writing something wrong? I'm totally clueless...

Author:  james_ [ Thu Jun 05, 2008 12:18 pm ]
Post subject: 

You have to correct the following details in this script:

dbhost = "localhost"; // usually this is localhost but if it doesn't work, check with your hosting provider
$dbname = "name"; // the name of the database you want to use
$dbuser = "name"; // your mySQL username (must have access to the database above!)
$dbpass = ""; // your mySQL password

// Choose a password to access admin.php
$admin_password = "";


All this information can be gathered from the MySQL Manager menu, from your control panel.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/