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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:34:12+00:00 2026-06-13T10:34:12+00:00

I looked through the documentation and I didn’t seem to find anything describing how

  • 0

I looked through the documentation and I didn’t seem to find anything describing how to do what I’m attempting. Then again, I didn’t find anything saying you couldn’t either.

$querytotal = "insert into offer_det where where fname = '".$fname."' and lname = '".$lname."' ORDER BY id DESC LIMIT 1 (`t1`, `t2`, `t3`, `t4`)
values($t1, $t2, $t3, $t4)";
$resultotal = mysql_query($querytotal);

My question: Is this an appropriate INSERT statement to make? Essentially I’m just needing to match the first and last name, and then pick the most recent table entry for them, since there could be multiple table entries with the same first and last name. From there all I need to do is insert the four values t1-4 with my variables $t1-4.

I saw this link but it didn’t make a whole lot of sense.

Thanks for bearing with me on this one.

  • 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-13T10:34:13+00:00Added an answer on June 13, 2026 at 10:34 am

    Your sql is incorrect. Try this.

    RE-RE EDITED:

    $querytotal = "insert into offer_det (`t1`, `t2`, `t3`, `t4`) values(’$t1’, ’$t2’, ’$t3’, ’$t4’) where  id = (SELECT max(id) FROM offer_det where fname = '".$fname."' and lname = '".$lname."')"; 
    $resultotal = mysql_query($querytotal); 
    

    But are you sure you need an insert and not an update query?

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

Sidebar

Related Questions

I've searched on stackoverflow, but didn't find anything, and looked through the as3 documentation
I looked through the documentation but couldn't find if there is a way to
I've looked through the documentation, and searched quite a bit now, and couldn't find
I have looked through the documentation but cannot seem to find the answer. Suppose
I looked through other questions and couldn't find what I needed. Best if I
I looked through the existing questions of this kind but didn't find what I
I looked thru the documentation a bit but didn't see anything of much substance
I have looked through the documentation and the only reference I can find is
I have looked through GDB documentation, but haven't found anything that works or shows
Looked through the documentation in the .NET reference but it didn't say. List<TransactionInfo> currentIdsForValuation

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.