logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Overlapping Data

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related
View previous topic :: View next topic  
Author Message
perxx82



Joined: 02 Mar 2010
Posts: 4

PostPosted: Tue Mar 02, 2010 11:59    Post subject: Overlapping Data Reply with quote

Hey guys,
I'm not 100% sure this is the correct forum to post in, but here goes:

I've been given access to an old PW module (Dragon Myrth) that I'm trying to get up and running.
This module is already scripted to work persistantly with a SQL dBase, and was doing so fine, when it was in operation (some 5 years ago..)

I have no prior knowledge as of how exactly that SQL dBase was set up, but using trial and error (loading the mod, trying to connect as a player, looking at the nwnx_odbc.txt for errors, and then creating the tables and fields it was looking for), it seems, I've managed to create a dBase NWN is happy with. All fields are so far created as VarChar (50)
Data is being written to the SQL dBase, and NWN is able to read from the dBase.
Here's my problem though: While it is writing player data, such as account information, character location etc, it appears to only do so for 1 player. If another player joins later, it will be his data stored, but the first one is now missing.
Seeing as the mod previously ran with a fairly large playerbase, and nothing is altered in the mod (except updating it to use the expansionsets, and from CEP 1.52 to 2.3), I'm guessing the issue might be with the SQL dBase itself. I'm not sure what would be the cause of that though.
Do you guys have any suggestions what I might be looking at?
Back to top
View user's profile Send private message
perxx82



Joined: 02 Mar 2010
Posts: 4

PostPosted: Tue Mar 02, 2010 13:56    Post subject: Reply with quote

Just to clarify a bit:
Data is being stored in the dBase, for instance in the accounts table:

~ VDKU7WLG lotr 060782 30
~ 060782 lotr VDKU7WLG 30

If I log out, and login with another accout, it'll look like this:

~ QLULH4WN lotr PerXX82 30
~ PerXX82 lotr QLULH4WN 30


However, it should be keeping both accounts, rather than overwriting what's already there. It should look like this:


~ VDKU7WLG lotr 060782 30
~ 060782 lotr VDKU7WLG 30
~ QLULH4WN lotr PerXX82 30
~ PerXX82 lotr QLULH4WN 30
Back to top
View user's profile Send private message
perxx82



Joined: 02 Mar 2010
Posts: 4

PostPosted: Thu Mar 04, 2010 9:48    Post subject: Reply with quote

Allright, I'm thinking it's most likely due to the fact that there's no primary key right now.

I've tried setting the 'name' field (2. from right) as Primary Key, but that didn't appear to have any effect.

Which one would be the preferred PK in this setup?
Back to top
View user's profile Send private message
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Thu Mar 04, 2010 12:22    Post subject: Reply with quote

Posting the actual code that's doing the inserts would be helpful. Otherwise we're flailing in the dark and can't really help.
Back to top
View user's profile Send private message
perxx82



Joined: 02 Mar 2010
Posts: 4

PostPosted: Thu Mar 04, 2010 17:51    Post subject: Reply with quote

Actually, I got it fixed.
As I suggested in the first post, the scripts were fine. The problem was that all fields was created as VarChars. Once they was set to their proper types, and an index of player, tag and name was created, things started working as intended Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group