View previous topic :: View next topic |
Author |
Message |
Extreme
Joined: 28 Nov 2007 Posts: 135
|
Posted: Tue Nov 18, 2008 18:26 Post subject: Setting up pwobjdata |
|
|
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 |
|
|
TroveLord
Joined: 22 Nov 2006 Posts: 136 Location: Italy
|
Posted: Tue Nov 18, 2008 18:32 Post subject: |
|
|
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 |
|
|
Extreme
Joined: 28 Nov 2007 Posts: 135
|
Posted: Tue Nov 18, 2008 18:32 Post subject: |
|
|
Thank you very much. ill just put this on a sign and set it up |
|
Back to top |
|
|
TroveLord
Joined: 22 Nov 2006 Posts: 136 Location: Italy
|
Posted: Tue Nov 18, 2008 18:33 Post subject: |
|
|
Read again my previous post. I edited it. |
|
Back to top |
|
|
Extreme
Joined: 28 Nov 2007 Posts: 135
|
Posted: Tue Nov 18, 2008 18:35 Post subject: |
|
|
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 |
|
|
Extreme
Joined: 28 Nov 2007 Posts: 135
|
Posted: Tue Nov 18, 2008 19:00 Post subject: |
|
|
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 |
|
|
Fireboar
Joined: 17 Feb 2008 Posts: 323
|
Posted: Tue Nov 18, 2008 21:22 Post subject: |
|
|
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 |
|
|
Extreme
Joined: 28 Nov 2007 Posts: 135
|
Posted: Tue Nov 18, 2008 21:24 Post subject: |
|
|
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 |
|
|
TroveLord
Joined: 22 Nov 2006 Posts: 136 Location: Italy
|
Posted: Wed Nov 19, 2008 2:53 Post subject: |
|
|
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 |
|
|
Fireboar
Joined: 17 Feb 2008 Posts: 323
|
Posted: Wed Nov 19, 2008 21:52 Post subject: |
|
|
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 |
|
|
|