There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
help!!! php/mysql and website


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
GreatEmporium's Avatar
Junior Member with 2 posts.
 
Join Date: May 2008
Experience: Beginner
20-May-2008, 11:04 PM #1
help!!! php/mysql and website
I read another thread on here similar to my problem but it was just a little different- and it didn't help me, still having same problems. This is what I'm getting when I click on my website: Warning: mysql_connect(): Unknown MySQL server host 'DB_SERVER' (1) in /home/content/g/r/e/greatembooks/html/includes/functions/database.php on line 12
Unable to connect to database server!

I have never used SQL or a php designed site before, so I'm sure it's error is with me and not the actual coding for the site...I hope. If anyone can help me, I would be greatly appreciative.
Following is the Instructions I received for setting up my site. I have posted the original here without my changed variables.

Edit the configuration files
You need to edit 2 files that you have uploaded to your webserver, they are: -
Includes/configure.php
Admin/includes/configure.php
These lines in the file need to be edited so that the server knows how to connect to
the website. Edit all the variables above the line "don't edit"
There will be a blank '' where you can place the variable.

And here is what I see when I open the includes/configure.php:

// Define the webserver and path parameters
// * DIR_FS_* = Filesystem directories (local/physical)
// * DIR_WS_* = Webserver directories (virtual/URL)

// add your database and website details to the variables below
define('DB_SERVER_USERNAME', '');
// your username that you use to log into your web server
define('DB_SERVER_PASSWORD', '');
// your password that you use to log into your web server
define('DB_DATABASE', '');
// your database
define('DIR_FS_CATALOG', '/home/username/public_html/');

define('HTTP_SERVER', 'http://www.yoursite.com');
define('HTTP_COOKIE_DOMAIN', '.yoursite.com');
// do not include the www
define('DB_SERVER', 'localhost');

// you do not need to change anything below

define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('HTTPS_COOKIE_DOMAIN', '');

define('HTTP_COOKIE_PATH', '/');

define('HTTPS_COOKIE_PATH', '');

define('DIR_WS_HTTP_CATALOG', '/');

define('DIR_WS_HTTPS_CATALOG', '');

define('DIR_WS_IMAGES', 'images/');

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_INCLUDES', 'includes/');

define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

define('HTTPS_SERVER', '');
define('ENABLE_SSL', false);
define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

define('USE_PCONNECT', 'false');
define('STORE_SESSIONS', 'mysql');
?>


And here is what I see when I open the admin/includes/configure.php:


// Define the webserver and path parameters
// * DIR_FS_* = Filesystem directories (local/physical)
// * DIR_WS_* = Webserver directories (virtual/URL)

// add your database and website details to the variables below
define('DB_SERVER_USERNAME', '');
// your username that you use to log into your web server
define('DB_SERVER_PASSWORD', '');
// your password that you use to log into your web server
define('DB_DATABASE', '');
// your database
define('DIR_FS_ADMIN', '/home/username/public_html/admin/'); // replace username with your web server username
define('DIR_FS_CATALOG', '/home/username/public_html/');
define('DIR_FS_DOCUMENT_ROOT', '/home/username/public_html');
define('SITE', 'www.yoursite.com');
define('WWW', 'http://www.yoursite.com');
define('HTTP_SERVER', 'http://www.yoursite.com');
define('HTTP_CATALOG_SERVER', 'http://www.yoursite.com');

define('DB_SERVER', 'localhost');


// you do not need to change anything below

define('DIR_WS_ADMIN', '/admin/');
define('DIR_WS_CATALOG', '/');
define('DIR_WS_IMAGES', 'images/');

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');

define('DIR_WS_INCLUDES', 'includes/');

define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');

define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');

define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');

define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');

define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');

define('HTTPS_CATALOG_SERVER', '');

define('ENABLE_SSL_CATALOG', 'false');
define('USE_PCONNECT', 'false');
define('STORE_SESSIONS', 'mysql');
?>
TheRobatron's Avatar
Computer Specs
Senior Member with 417 posts.
 
Join Date: Oct 2007
Location: England
Experience: Intermediate
30-May-2008, 05:07 AM #2
Can you post the code for the file that includes the mysql_connect()? And is your MySQL server actually on the localhost?
GreatEmporium's Avatar
Junior Member with 2 posts.
 
Join Date: May 2008
Experience: Beginner
30-May-2008, 09:46 AM #3
As dumb as this is going to sound here goes...I could if I knew where it was. I don't know a thing about MySQL coding.
TheRobatron's Avatar
Computer Specs
Senior Member with 417 posts.
 
Join Date: Oct 2007
Location: England
Experience: Intermediate
30-May-2008, 10:52 AM #4
Don't worry - I was learning once too . The mysql_connect() will be in the file that you're running when you get the error. The error may be because the database is not on the localhost. Did you set up the database yourself, or was it already created? Try changing localhost to the IP or URL of the database.
__________________
There's no place like 127.0.0.1

Reply

Tags
css, mysql


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 02:31 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.