|
From: 'Chris Winters' <ch...@cw...> - 2002-08-22 14:00:41
|
* Chris McDaniel (Chr...@te...) [020822 10:03]: > I have a new question - from reading the SPOPS::DBI module docs, it seems to > me that an object is meant to be sync'd with the database after a save, but > I can't seem to make that work - I have this code in a test class on my > server: > ... > Note that I am using the database auto increment for the id field, not the > OpenInteract one. Anyway, I don't get anything back when I ask for the ID. > Can anyone help? This had me scratching my head for a second, then it hit me: we can't sync the record with the database because we can't fetch the record from the database since we don't have an ID to fetch it with! If you just add 'increment_field => 1' to your configuration, SPOPS will use the MySQL auto-increment feature to get the ID of the record you just inserted. All the SPOPS auto-increment adaptations just wrap around the built-in database feature. This is very important since SPOPS is frequently used on top of existing datastores. Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988 |