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

  • Home
  • SEARCH
  • 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 7175125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:13:00+00:00 2026-05-28T16:13:00+00:00

so I have a php file called db.php which will be called in the

  • 0

so I have a php file called db.php which will be called in the web page :

<?php
define("EZSQL_DB_USER", 'xxxxx_xxxx');
define("EZSQL_DB_PASSWORD", 'xxxxxxx');
define("EZSQL_DB_NAME", 'xxxx_xxxx');
define("EZSQL_DB_HOST", 'localhost');
if (!function_exists('gettext')) {
function _($s) {return $s;}
}
?>

but on my website I want to check if the db is up and running:

<?php
$mysqlConnection = mysql_connect($server, $username, $password);
if (!$mysqlConnection)
{
  echo "Please try later.";
}
else
{
mysql_select_db($database, $mysqlConnection);
}
?>

I dont know were to place the variables and what variables to change….

thanks

  • 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-28T16:13:01+00:00Added an answer on May 28, 2026 at 4:13 pm

    I think you’re looking for the following:

    <?php
    $mysqlConnection = mysql_connect(EZSQL_DB_HOST, EZSQL_DB_USER, EZSQL_DB_PASSWORD);
    if (!$mysqlConnection)
    {
      echo "Please try later.";
    }
    else
    {
    mysql_select_db(EZSQL_DB_NAME, $mysqlConnection);
    }
    ?>
    

    The variables in the connection string have been replaced with the constants you define using the define function.

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

Sidebar

Related Questions

I have a PHP-file which will be called from a form. So it gets
I have a php file which I will be using as exclusively as an
I have a PHP file which will return something like <div id=title>Add Us On
I have a php-file called kal_test.php which gives a value to the variable $vbl
I have an index.php-file, which will echo the string with the returned .html-file prepared
I have a file called 34.php?session=2534464a39a2c97cb7113689726a4e52 in my /var/www/html folder but I can't view
We have a flash developer who uses calls a file called proxy.php with the
I have a filelist.txt file and I created a file called clear.php to clear
I have some jQuery code. I have called an Ajax function file, file.php, that
I have a symlink in our website called index.php which points to a script

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.