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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nierjesh
Forum Newbie
Posts: 2
Joined: Fri Jul 10, 2009 4:31 am

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

Post 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
User avatar
genconv
Forum Commoner
Posts: 34
Joined: Sun Jul 05, 2009 9:27 am

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

Post 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 :!:
nierjesh
Forum Newbie
Posts: 2
Joined: Fri Jul 10, 2009 4:31 am

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

Post by nierjesh »

I can not use the auto increment because there are more than one rows in a table against same id no.
Post Reply