I’m having trouble figuring out how to use LAST_INSERT_ID() for a MySQL database in WebMatrix. Can someone show me how to apply it to the code snippet below?
var clothingsize="";
if(IsPost){
clothingsize =Request["clothingsize"];
var SQLINSERT = "INSERT INTO fit1 (clothingsize) VALUES (@0)"; }
Here’s the solution that works:
Right after this code on the signup page
Add these 2 lines of code:
Then insert the following into the subsequent pages:
Before the var to open the database
Add the id number that’s been carried over into the INSERT functions. For example:
Carry over the id number to the next page
Thanks to @Mike Brind and the ASP.net forum for helping me figure this out 🙂