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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:28:33+00:00 2026-06-05T01:28:33+00:00

This is my first post on the site. I’m a newbie with mysql and

  • 0

This is my first post on the site. I’m a newbie with mysql and php so please pardon any mistakes and kindly point them out.
I have a table to store hiring details:

table_hiring
hiringid int(20) AUTOINCREMENT => (primary key);
hiringname varchar(80);
hiringdate bigint(20);
…
…

I have another table to store the tools and their hire prices which has:

table_tools
tool_id int(10)AUTOINCREMENT => (primary key);
tool_description varchar(100);
tool_price double;

Each hire request would be saved in the hiring table. My problem is that each hire request can have multiple tools(Its a ground hire. so the hirer can request a hurdles set, a shotput set and a javelin set and so on.). I was stumped with the problem of storing multiple values in a single field. I did some research and decided to have another table

table_tool_hire
tool_hire_id() => (primary key from table_hiring);
tool_id() => (primary key from table_tools);
tool_hire_date bigint(20);

The problem is that everytime there is a hire request, according to the hirer’s request i need to populate table_hiring and table_tool_hire in one query and the hire Id needs to be the matching in both the tables.

How do I insert the values into table_hiring and simultaneously get the autoincremented id value of that hire to be updated into the table_tool_hire table?? Please help…Thanks in advance…

  • 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-05T01:28:34+00:00Added an answer on June 5, 2026 at 1:28 am

    For PHP, this is found with mysql_insert_id().
    For .NET, take a look at this.

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

Sidebar

Related Questions

This is my first post in this forum, so please, be patient with me.
This is my first post on stackoverflow, so please excuse me if my question
This is my first post on Stack, so please bear with me if I
My first post on this site with huge hope:: I am trying to understand
This is my first post, but I've loved using this site as resource for
this is the first question I post in this site, so you have to
This is my first post on this site :-) I'm learning F#. To do
This is my first post, but I have been using this site for a
This is my first post, but I've been using the site for years. However,
this is my first post to stackoverflow, but I've used this amazing site before.

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.