Hello all, i get this error while inserting and udating some tables.Duplicate entry '9105224' for key 'PRIMARY'error no:1062error:1062 .number 9105224 is randomly generated and set in u_id field in one of the tables in MYSQL, which is set to unique and primary.The sql querries are working fine and the rows are also affected.but it gives me duplicate entry error..plz help..Is it bcoz at first nunber is generated and checked against existing numbers in u_id field and if match is found it gives error and immediately generates another random number ( but in this case how can random number be generated again??i havnt written any code for such duplicate cases where call can be made to rand() ) and writes in place of u_id again with new entry??..
HELP ME OUT..SOS!! :|
Jump to Post
if i understand you insert a random number into your primary key ?
if so, i dont think you can do that, cause even if theyre random, at some point youll end up with the same entry.
if im in the ditch, please give us more details and maybe show …
All 7 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.