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 
 
Setting up pwobjdata

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



Joined: 28 Nov 2007
Posts: 135

PostPosted: Tue Nov 18, 2008 18:26    Post subject: Setting up pwobjdata Reply with quote

anyone have a script i can use to set up the table? I used the script in SimTools to set up the main table. I just never realized i didnt have this set up

Code:
o ERROR: [3] Table 'account_NWN.pwobjdata' doesn't exist
Back to top
View user's profile Send private message
TroveLord



Joined: 22 Nov 2006
Posts: 136
Location: Italy

PostPosted: Tue Nov 18, 2008 18:32    Post subject: Reply with quote

Code:
CREATE TABLE IF NOT EXISTS `pwobjdata` (
  `player` varchar(64) collate utf8_unicode_ci NOT NULL default '',
  `tag` varchar(64) collate utf8_unicode_ci NOT NULL default '',
  `name` varchar(64) collate utf8_unicode_ci NOT NULL default '',
  `val` blob,
  `last` timestamp NOT NULL default CURRENT_TIMESTAMP,
  PRIMARY KEY  (`player`,`tag`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


pwdata in case you need it:
Code:
CREATE TABLE IF NOT EXISTS `pwdata` (
  `player` varchar(64) collate utf8_unicode_ci NOT NULL default '',
  `tag` varchar(64) collate utf8_unicode_ci NOT NULL default '',
  `name` varchar(64) collate utf8_unicode_ci NOT NULL default '',
  `val` text collate utf8_unicode_ci,
  `expire` int(11) default NULL,
  `last` timestamp NOT NULL default CURRENT_TIMESTAMP,
  PRIMARY KEY  (`player`,`tag`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


Last edited by TroveLord on Tue Nov 18, 2008 18:33; edited 1 time in total
Back to top
View user's profile Send private message
Extreme



Joined: 28 Nov 2007
Posts: 135

PostPosted: Tue Nov 18, 2008 18:32    Post subject: Reply with quote

Thank you very much. ill just put this on a sign and set it up
Back to top
View user's profile Send private message
TroveLord



Joined: 22 Nov 2006
Posts: 136
Location: Italy

PostPosted: Tue Nov 18, 2008 18:33    Post subject: Reply with quote

Read again my previous post. I edited it.
Back to top
View user's profile Send private message
Extreme



Joined: 28 Nov 2007
Posts: 135

PostPosted: Tue Nov 18, 2008 18:35    Post subject: Reply with quote

ummm...i think i have that one. the normal setPersistentInt/string and whatnot are fine. i set them up a long time ago when i set up the simtools. I just assumed that i had the Object table set up
Back to top
View user's profile Send private message
Extreme



Joined: 28 Nov 2007
Posts: 135

PostPosted: Tue Nov 18, 2008 19:00    Post subject: Reply with quote

this is what i have for setting up pwdata on MySQL.
Code:
SQLExecDirect("CREATE TABLE pwdata (" +
"player varchar(64) NOT NULL default '~'," +
"tag varchar(64) NOT NULL default '~'," +
"name varchar(64) NOT NULL default '~'," +
"val text," +
"expire int(11) default NULL," +
"last timestamp NOT NULL default CURRENT_TIMESTAMP," +
"PRIMARY KEY (player,tag,name)" +
") ENGINE=MyISAM DEFAULT CHARSET=latin1;");


how do i format the pwobjdata command given, so that i can execute this properly on MySQL on a linux server
Back to top
View user's profile Send private message
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Tue Nov 18, 2008 21:22    Post subject: Reply with quote

That depends. If you just log into the SQL database directly you can run the query as written. To run it via scripts in NWN, simply stick it in a normal string like so:

Code:
SQLExecDirect("CREATE TABLE IF NOT EXISTS pwobjdata (" +
  "`player` varchar(64) collate utf8_unicode_ci NOT NULL default ''," +
  "`tag` varchar(64) collate utf8_unicode_ci NOT NULL default ''," +
  "`name` varchar(64) collate utf8_unicode_ci NOT NULL default ''," +
  "`val` blob," +
  "`last` timestamp NOT NULL default CURRENT_TIMESTAMP," +
  "PRIMARY KEY  (`player`,`tag`,`name`)" +
  ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci");


The ` marks are optional, but the ' marks are compulsory.
Back to top
View user's profile Send private message
Extreme



Joined: 28 Nov 2007
Posts: 135

PostPosted: Tue Nov 18, 2008 21:24    Post subject: Reply with quote

well i knew i could plug in the string fine. i was just worried about the unicode due to that not being in the pwdata code i used
Back to top
View user's profile Send private message
TroveLord



Joined: 22 Nov 2006
Posts: 136
Location: Italy

PostPosted: Wed Nov 19, 2008 2:53    Post subject: Reply with quote

Fireboar wrote:
The ` marks are optional

They are mandatory for fields like "last" and "name".
And, I would create the tables through the mysql client rather than IG.
Back to top
View user's profile Send private message
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Wed Nov 19, 2008 21:52    Post subject: Reply with quote

TroveLord wrote:
Fireboar wrote:
The ` marks are optional

They are mandatory for fields like "last" and "name".
And, I would create the tables through the mysql client rather than IG.


Ah, true. Any fields with names which have special meaning in SQL need the quotes.
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