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 7082413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:03:05+00:00 2026-05-28T07:03:05+00:00

I installed PHP and Mysql to run on IIS6 (only installed both, and I

  • 0

I installed PHP and Mysql to run on IIS6 (only installed both, and I am unknown about the setup to get them [PHP and MYSQL] to work together) and I use the following code to create a table in EMPLOYEE in the PEOPLE database I issued from mysql client command line.

<?php
$username="root@localhost";
$password="password";
$database="people";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die("Unable to select database");
$query="CREATE TABLE EMPLOYEE (id INT(7) NOT NULL 

AUTO_INCREMENT,FirstName VARCHAR(15) NOT NULL, LastName VARCHAR

(15) NOT NULL, PhoneNumbers VARCHAR(20) NOT NULL, MobileNumbers 

VARCHAR(20), Position VARCHAR(30) NOT NULL, PRIMARY  KEY(id))";
mysql_query($query);
mysql_close();
?>

Yet, it displays the die message. I search google for the setup of mysql and php but fail to see any corrections of php.ini offered to run the script with the database. Thank you for any help.

EDIT:
Thank you for your concerns, it works after corrected as follows,

    <?php
    $username="root";
    $password="password";
    $database="people";
    mysql_connect(localhost,$username,$password);
    @mysql_select_db($database) or die("Unable to select database");
    $query="CREATE TABLE EMPLOYEE (id INT(7) NOT NULL 

    AUTO_INCREMENT,FirstName VARCHAR(15) NOT NULL, LastName VARCHAR

    (15) NOT NULL, PhoneNumbers VARCHAR(20) NOT NULL, MobileNumbers 

    VARCHAR(20), Position VARCHAR(30) NOT NULL, PRIMARY  KEY(id))";
    mysql_query($query);
    mysql_close();
    ?>
  • 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-28T07:03:06+00:00Added an answer on May 28, 2026 at 7:03 am

    Instead of just saying there’s a problem, have it tell you what the problem is:

    @mysql_select_db($database) or die("Unable to select database: " . mysql_error());
    

    For debugging/developing, you should have an or die(mysql_error()) after EVERY mysql_*() function call.

    The problem is this:

    mysql_connect(localhost,$username,$password);
                  ^^^^^^^^^
    

    That’s an unquoted string, which’ll be interpreted as an undefined constant by PHP, evaluating to a null string – so you’re trying to connection to… “nothing”.

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

Sidebar

Related Questions

I installed php and mysql on a Windows 2003 server running IIS6. I uncommented
I installed XAMPP to run PHP from eclipse. I have a standalone MySQL server
I just installed Delphi for PHP to get an idea on how it works
I'm working on Windows with Apache and PHP. I just installed MySQL, configured it,
can I run Apache, PHP and MySQL on a External HD? I need this
I want to start learning PHP, so I installed Apache2, MySQL and PHP5 on
I'm from PHP background. I used to use Apache, MySQL and PHP for web
I have apache, mysql, php installed manually on windows xp. How can I make
I'm trying to get away from using Mamp, so have recently installed mysql, edited
I have installed Apache 2.2 (and PHP/MySQL) on my personal computer so I can

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.