469,645 Members | 1,174 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

increment duplicate sting key


Can anyone help me to increment the primary key's value on duplication
without using mysql v 4.1 "on duplicate key" function? I can't
upgrade to use the "on duplicate key" feature so am now running into
the problem of using a string name as the primary key and wanting its
value incremented when I try to add another string with same name.
example.. if I had a column of authors and a column of #books: Jon -2,
Mary-3, and Joe-1. And I want to enter another book base on the
primary key authors..so if I enter Jon, a duplicate error would occur
but I want the book column that match Jon increment by one so Jon-3
occurs and if the author's name is Dave then it'll create a new
primary key "Dave". I'm pretty new to mysql so any suggestions would
be great!

Jul 19 '05 #1
0 965

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Burghew | last post: by
4 posts views Thread by Burghew | last post: by
3 posts views Thread by George Ter-Saakov | last post: by
7 posts views Thread by ucfcpegirl06 | last post: by
5 posts views Thread by Gregory Piñero | last post: by
11 posts views Thread by divya_rathore_ | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.