MYSQL listing
#1

Hello everyone, i'm having a following problem.

When i'm ingame creating an apartment it creates it into database with id 1.
When i delete this apartment and create once a gain it creates it into database with id 2. even if i have nothing else in there. And because of that I can't dynamic manage my apartment because ingame it shows his id as one but mysql id is 2. How to get this fixed?
Reply
#2

Then you must do a SELECT statement to see if anyone's apartment ID corresponds to the deleted apartment and set it to 0. Then your problem will not exist any more.

Hope that helps.
- Firewire.
Reply
#3

I assume the ID field is auto incrementing. So an easy solution for you now is, add a field called 'deleted', set it to 1 when you want to delete an apartment, and just rewrite over it when you want to create a new one over it. This is the one of the most easiest solutions you can manage given you have already scripted it, right? This also provides the advantage of being able to undo any deletions you did by mistake.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)