Jump to content

PHP for MySql


me222

Recommended Posts

Hi, can anybody help me, because I am having trouble connecting to a database. This is the error message that I get everytime I open the site:

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'DB_SERVER_USERNA'@'localhost' (using password: YES) in /home/me222/public_html/includes/functions/database.php on line 12

Unable to connect to database server!

 

Below is my config.php:

 

define('DB_SERVER_me222', '');

    // your username that you use to log into your web server

define('DB_SERVER_handyman', '');

  // your password that you use to log into your web server

define('DB_DATABASE', 'me222_books');

          // replace username with your web server username

define('DIR_FS_CATALOG', '/home/me222/public_html/');

   

define('HTTP_SERVER', 'http://www.site.com');

define('HTTP_COOKIE_DOMAIN', '.site.com');

  // do not include the www

 

 

define('DB_SERVER', 'localhost');

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'); 

?>

 

 

 

Thanks

 

Ellie

Link to comment
Share on other sites

Thanks for the info, but I am not much of a programmer, actually knows almost nothing about computers.  I bought the script from somebody else.  It is supposed to be very simple just by modifying the lines in the config file, but unfortunately it doesn't work.  Anyway thank you for trying to help

 

Ellie

Link to comment
Share on other sites

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'DB_SERVER_USERNA'@'localhost' (using password: YES) in /home/me222/public_html/includes/functions/database.php on line 12

Unable to connect to database server!

 

clown, if you read the error message you will see that the OP is using mysql_connect as it is mysql_connect that is generating the error.

 

To the OP, the pertinent part of the error is:

Access denied for user 'DB_SERVER_USERNA'@'localhost'

 

Where ever the code is that actually connects, it is trying to use a constant named DB_SERVER_USERNA.

The code you posted:

<?php
define('DB_SERVER_me222', '');
    // your username that you use to log into your web server
define('DB_SERVER_handyman', '');
   // your password that you use to log into your web server
define('DB_DATABASE', 'me222_books');
          // replace username with your web server username
?>

 

You have changed DB_SERVER_USERNA to DB_SERVER_handyman.

 

Try:

<?php
  define('DB_SERVER_USERNA', 'handyman');
?>

 

I have a feeling you're going to receive more errors though.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.