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.
Your sql is incorrect. Try this.
RE-RE EDITED:
But are you sure you need an insert and not an update query?