Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3756684
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:53:23+00:00 2026-05-19T09:53:23+00:00

I am attempting to create a database config file that contains DB details, and

  • 0

I am attempting to create a database config file that contains DB details, and then include the file in the files that I will be doing queries on, but I keep getting errors, it seems to be taking the constant as a string instead of it’s value.

Here is the config.php code:

define("DB", "db", true);
define("LOGIN", "login", true);
define("PASS", "pass", true);
define("HOST", "server.com", true);

and here is where I include and use the constants:

include("config.php");

$province = $_POST['province'];
$city = $_POST['city'];
$name_surname = $_POST['name_surname'];
$email_address = $_POST['email_address'];
$date = date("m.d.y");


$connect = mysql_connect(HOST,LOGIN,PASS) or die(mysql_error());
mysql_select_db(DB) or die(mysql_error());

mysql_query("INSERT INTO table_name (id, province, city, name_surname, email_address, date)
VALUES ('NULL', '$id', '$province', '$city', '$name_surname', '$email_address', '$date')", $connect) or die(mysql_error());

edit* Here is the error I am getting Access denied for user 'USER'@'100-200-0-200.dynamic.adsl.com' (using password: YES)

Any idea where I am going wrong? It’s probably staring me in the face, but I just can’t see it.

Thanx in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T09:53:24+00:00Added an answer on May 19, 2026 at 9:53 am

    Without the specific error message generated it’s hard to be certain, but I suspect the issue is simply that the define is called “LOGIN”, but you’re attempting to use “USER” in the mysql_connect call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to create a web page that will allow a user to
I'm attempting to create a java program that will allow me access to an
I've been attempting to create a task that writes to a database without blocking
I'm attempting to create a process that verifies data within a database and notifies
I am attempting to create a procedure that selects ads from a database in
I am attempting to create a Stored Procedure for a newly created database. However
I'm attempting to create a custom calendar control that inherits from ASP.Net's built in
I'm attempting to create an order number for customers to use. I will have
I'm attempting to create a database application for a bookstore. In the spec: After
I'm attempting to use Wix to create a database during install. I have my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.