| List: | MySQL++ | « Previous MessageNext Message » | |
| From: | Chris Frey | Date: | March 14 2005 8:47pm |
| Subject: | Re: auto_increment | ||
| View as plain text | |||
On Mon, Mar 14, 2005 at 08:35:27PM +0100, Joachim Person wrote: > and subscription also has a "id" field which is auto_increment, doesn't > work. The id field gets some seemingly random value. How can I make sure > auto_increment works? auto_increment happens at the database level. I don't believe mysql++ automatically updates the struct with the new id, you need to get it yourself with the insert_id() call. query.store(); int id = connection.insert_id();// do this right after the // insert operation - Chris
| Thread | ||
|---|---|---|
| • auto_increment | Joachim Person | 14 Mar |
| • Re: auto_increment | Chris Frey | 14 Mar |
| • Re: auto_increment | Earl Miles | 14 Mar |
| • Re: auto_increment | Chris Frey | 15 Mar |
| • sql_create in header | don thompson | 7 Apr |
| • Re: sql_create in header | Warren Young | 8 Apr |
| • Re: sql_create in header | don thompson | 8 Apr |
| • Re: sql_create in header | Warren Young | 9 Apr |
| • Re: auto_increment | Warren Young | 15 Mar |
| • Re: auto_increment | Warren Young | 15 Mar |
