Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subsonic 3.0.0.4 active record templates for mysql not returning last inserted id #245

Closed
geocine opened this issue Dec 3, 2010 · 1 comment

Comments

@geocine
Copy link

geocine commented Dec 3, 2010

Steps to reproduce error:

CREATE TABLE `person` (
  `person_id` int(11) NOT NULL AUTO_INCREMENT,
  `firstname` varchar(20) DEFAULT NULL,
  `lastname` varchar(20) DEFAULT NULL,
  `age` int(11) DEFAULT '0',
  PRIMARY KEY (`person_id`)
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=latin1

INSERT INTO `person`(`firstname`,`lastname`,`age`)
 VALUES ('myname',NULL,NULL)
;SELECT LAST_INSERT_ID() as newid
Person personObject = new Person();
personObject.Firstname= "myname";
personObject.Add();
Response.Write(personObject.PersonId);

output is 0

@geocine
Copy link
Author

geocine commented Oct 10, 2017

closing an issue I opened 7 years ago 🔢

@geocine geocine closed this as completed Oct 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant