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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:35:01+00:00 2026-05-27T17:35:01+00:00

Assume I’ve got the table: CREATE TABLE test ( ID INT AUTO_INCREMENT PRIMARY KEY,

  • 0

Assume I’ve got the table:

CREATE TABLE test (
    ID INT AUTO_INCREMENT PRIMARY KEY,
    InsertTime DATETIME
) ENGINE = InnoDB;

And, through an Apache/PHP website, as a response to web requests, I keep doing this:

INSERT INTO test (InsertTime) values (NOW());

Is it safe to assume that if row1.ID > row2.ID then row1.InsertTime >= row2.InsertTime? Or perhaps through some unfortunate combination of factors (multi-CPU server in a replicated environment with the moons of Jupiter in the correct alignment etc.) this can fail?

Note: I don’t have any issues. I’m writing a new piece of software and am wondering if I can rely on sorting by ID to also sort by dates (only NOW() will even be inserted into that column).

  • 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-27T17:35:02+00:00Added an answer on May 27, 2026 at 5:35 pm

    I think most problems will come from the call to NOW() instead of the AUTO_INCREMENT. I suspect most computers at some point print NOW() dates out of order! This is usually either because a sysadmin changed the clock, or because NTP changed the clock.

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

Sidebar

Related Questions

Assume a table structure of MyTable(KEY, datafield1, datafield2...) . Often I want to either
Assume that the class Data is defined as {DateTime TransactionDate, int ItemCount} . I
Assume that the database connection is good, the table name and column name are
Assume there is a file test.txt containing a string 'test' . Now, consider the
Assume I've this parser: let test p str = match run p str with
Assume I have a code like this: @autoreleasepool { for(int i = 0; i
Assume we have these two tables, binded by foreign key CAT_ID: Category[CAT_ID,CAT_NAME] cat_id =
Assume we have a user table to be partitioned by user id as integer
Assume I have an Excel add-in called test.xlam that contains this procedure: Sub TestAbb()
Assume java 1.6 and leopard. Ideally, it would also be nice to get a

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.