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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:10:54+00:00 2026-06-08T04:10:54+00:00

I have a database with an Auto increment field. I want to retrieve the

  • 0

I have a database with an Auto increment field. I want to retrieve the value of the Auto increment column whenever i insert a record in database. I am using mysql as my database and PHP as my programming language. I tried using mysql_insert_id() function but then it is not suitable when there are large number of insertion taking place at same point of time.

I want to retrieve the value of AI column because i am storing a file for respective record and since i am storing the files in a single directory i need the file name to be unique. Any other way to do the same thing?

  • 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-06-08T04:10:56+00:00Added an answer on June 8, 2026 at 4:10 am

    It should be safe for you to use mysql_insert_id(), because it will return the last inserted AI value of the current connection (see php.net). So as long as you call the method right after the INSERT query in your script, there won’t be any race conditions, even if your script is running concurrently multiple times.

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

Sidebar

Related Questions

I have one database table TABLE_TIPS with two value 1. tips_id (auto increment) 2.
I have a MySQL table with an auto-increment ID field. I'm filling the table
I am using PDO in PHP and a MySQL database. What I want to
I have a mysql database in which i am using auto_increment(integer), can you tell
I have a mysql database and some php that allows you to create an
I have a database with existing data, where previously I've been using AUTO_INCREMENT on
All tables in my database always have an id (autoincrement), at column 0 regardless
In my database I have three tables: Users: UserID (Auto Numbering), UserName, UserPassword and
I am trying to have a textBox auto complete with values from a database.
I have a MySQL database which contains a table of users. The primary key

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.