Page 1 of 1

same id no genrated when multiple user try to save the data

Posted: Fri Jul 10, 2009 4:38 am
by nierjesh
Dear All

In my database there is a table having integer data type(not auto increment) when more than one user try to save the data then same id no is allotted for both .id no is generated by using the max(idno)+1 .to solve this issue i have used "lock tables tab_name write" but after using this when i try to populate the data from any other table then it returns 0.


is there any way to lock only one table so that other table could not be affect.





Regards-
Nierjesh

Re: same id no genrated when multiple user try to save the data

Posted: Fri Jul 10, 2009 4:48 am
by genconv
Why don't you use a auto increment?
id no is generated by using the max(idno)+1
This is a very bad solution :!:

Re: same id no genrated when multiple user try to save the data

Posted: Fri Jul 10, 2009 5:37 am
by nierjesh
I can not use the auto increment because there are more than one rows in a table against same id no.