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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:53:37+00:00 2026-05-30T21:53:37+00:00

My server is on hostgator running on a linux centOS. I’m simply trying to

  • 0

My server is on hostgator running on a linux centOS.

I’m simply trying to create a table within my database and I figured out how to get the table to get created. Although when I add the AUTO_INCREMENT setting the code doesn’t execute and the table isn’t created.

Why would this be and how can I correct it?

Here is my code:

$members2_table = "CREATE TABLE ninja08_codin.members2(
        id INT NOT NULL AUTO_INCREMENT,
        first_name VARCHAR(40),
        last_name VARCHAR(40) NOT NULL,
        email VARCHAR(64) NOT NULL,
        date_joined TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
        cred VARCHAR(10) NOT NULL)";
  • 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-30T21:53:38+00:00Added an answer on May 30, 2026 at 9:53 pm

    To use AUTO_INCREMENT you may have to assign the column as a primary key:

    $members2_table = "CREATE TABLE ninja08_codin.members2(
            id INT NOT NULL AUTO_INCREMENT,
            first_name VARCHAR(40),
            last_name VARCHAR(40) NOT NULL,
            email VARCHAR(64) NOT NULL,
            date_joined TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
            cred VARCHAR(10) NOT NULL,
            PRIMARY KEY (id))";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running an ecommerce theme on wordpress on a hostgator server, and coming
I'm trying to install magento in a subdirectory on my hostgator server. I did
I'm trying to upload my asp.net site to my HostGator windows server. I'm having
Let me first say that I am running on a shared linux server with
When I moved my sites to a dedicated server from HostGator, several things were
I have a server in Texas USA (hostgator), my domain (.be) is bought at
I'm trying to use PHP to create a file, but it isn't working. I
Server: MS Sql Server 2008 When i create an indexed view .. and i
I'm working on a Hostgator dedicated server where there are hundreds of sites that
I have my cakephp 1.3 console installed on hostgator server using SSH. I baked

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.