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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:21:22+00:00 2026-06-11T21:21:22+00:00

In php have a form with a textarea and a file upload. In mysql

  • 0

In php have a form with a textarea and a file upload. In mysql I have table 1 with rows for each uploaded file having data like name, size, etc… and I have table 2 with the data entered in the textarea and a column with the id of the file uploaded.

I’m using mysql_insert_id to get the id of the last inserted row in table 1 (the id of file uploaded). Then I insert that id in table 2.

Assuming that multiple uploads are made at the same by different users will mysql_insert_id return the proper id each time? What happens if 2 users upload at the exact time.. Or there is a timeout.. I guess I’m asking if there’s a better way to insert a newly created id to 2 tables at the same time?

  • 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-11T21:21:24+00:00Added an answer on June 11, 2026 at 9:21 pm

    It returns the id of inserted row for the session from which the insert has been made. So yes, you’re doing it just fine.

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

Sidebar

Related Questions

I have this form: <form name=commentform id=commentform action=comment.php method=post enctype=multipart/form-data> Your Name: <textarea maxlength=60
I have file with name contact.php, inside I have form: <form method=post name=kontakt action=send_mail.php>
In a form in PHP, I have a textarea and a Choose File option.
<form action=mail.php method=post target=_blank> <textarea name=mess cols=50 rows=5></textarea> <input name=send type=submit value=Send> </form> After
I have simple form: <form action=add.php method=post > <input name=name maxlength=30/><br/> <textarea cols=80 name=description
(Using MySQL and PHP) I have a search form that will allow my users
I have form like this: <form method=POST action=<?php echo base_url() ?>admin/admin_search> <fieldset> <label for=nalozi>Nalozi</label><input
I have a simple table for reference page: id name description image In reference.php,
I have a file named discussion.php , where a form is located. In this
I have a working Ajax form, now I'm trying to add file upload to

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.