/ Published in: SQL
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
INSERT INTO users (firstName, lastName, email ) VALUES ( '#FORM.LastName#', '#FORM.LastName#', '#FORM.email#' ); SELECT thisID = @@IDENTITY ---------------------------------------------------------------------- The PRIMARY KEY IS THEN referenced AS Q_QueryName.thisID "thisID" can be renamed TO whatever you LIKE I USE this code IN ColdFusion, I assume it works IN any LANGUAGE that supports SQL querying.