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 
 
Return empty?

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



Joined: 26 Jun 2007
Posts: 8

PostPosted: Tue Jun 26, 2007 0:57    Post subject: Return empty? Reply with quote

NWNX MySQL Plugin V.0.0.7
(c) 2007 by Ingmar Stieger (Papillon)
visit us at http://www.nwnx.org
(built using mysql-5.0.27 source)

* Log level set to 2 (everything)
* Connecting to server localhost
* Plugin initialized.
* Registering under function class SQL
* Executing: SELECT Name from TabPG where Id = 1
* Returning: (empty) (column 1)

if I try launch query in MYSQL Query browser gives back me a valid result, what is of wrong?
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Tue Jun 26, 2007 10:19    Post subject: Reply with quote

Are you sure you are accessing the same database (happened to me...) ?
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Quizz68



Joined: 26 Jun 2007
Posts: 8

PostPosted: Tue Jun 26, 2007 14:35    Post subject: Reply with quote

Papillon wrote:
Are you sure you are accessing the same database (happened to me...) ?


yes i have only one Sad Rolling Eyes
Back to top
View user's profile Send private message
Quizz68



Joined: 26 Jun 2007
Posts: 8

PostPosted: Tue Jun 26, 2007 17:30    Post subject: Reply with quote

me is not clear the solution? things I must make in order to resolve the problem?

http://www.nwnx.org/phpBB2/viewtopic.php?t=792

Rolling Eyes
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Wed Jun 27, 2007 19:16    Post subject: Reply with quote

Uh, pardon ?
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Quizz68



Joined: 26 Jun 2007
Posts: 8

PostPosted: Thu Jun 28, 2007 12:57    Post subject: Reply with quote

I do not understand what agrees with this phrase "... NWNX doesn't react the same to invalid indexes as PHP SQL does.", I must set the indices in a particular way ?


thanks
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sun Jul 08, 2007 20:16    Post subject: Reply with quote

No, I think the author meant that NWNX does not react like the PHP stuff does, if you pass it an invalid index.

Remember, 0 is the first column, 1 the second, and so on.

Now that you mentioned it... you should rewrite your SQLGetData statement... you have only one column in your result set (Name) and you try to get the second column (1).
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Quizz68



Joined: 26 Jun 2007
Posts: 8

PostPosted: Tue Jul 10, 2007 13:44    Post subject: Reply with quote

Papillon wrote:
No, I think the author meant that NWNX does not react like the PHP stuff does, if you pass it an invalid index.

Remember, 0 is the first column, 1 the second, and so on.

Now that you mentioned it... you should rewrite your SQLGetData statement... you have only one column in your result set (Name) and you try to get the second column (1).


this is my script query


string SQLStr = "SELECT Name from TabPG where Id = 1";
SQLExecDirect(SQLStr);
while (SQLFetch() == SQL_SUCCESS)
{
NamePG = SQLGetData(0);
}


and this is result


NWNX MySQL Plugin V.0.0.7
(c) 2007 by Ingmar Stieger (Papillon)
visit us at http://www.nwnx.org
(built using mysql-5.0.27 source)

* Log level set to 2 (everything)
* Connecting to server localhost
* Plugin initialized.
* Registering under function class SQL
* Executing: SELECT Name from TabPG where Id = 1
* Returning: (empty) (column 1)

and the NamePG is = to "" i try this query "SELECT * from TabPG where Id = 1" but the result is * Returning: (empty) (column -1)
Rolling Eyes Sad

i need some mysql dll in nwnx4 directory?
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sat Jul 14, 2007 15:51    Post subject: Reply with quote

Ah sorry, my last statement is confusing. Let me rephrase:

If you write SQLGetData(1) in nwscript, that means: Get the first column of the resultset.

In the logfile, you should see: * Returning: abc1 (column 0), since 0 is the first column from the MySQL plugin's perspective.

So in your case, this should be in the logfile: * Returning: (empty) (column 0)

I'm am not sure what is going on... please double check your SQLGetData call and make sure that there is no other call to SQLGetData(2) somewhere else, which could produce this entry in the log file...
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Quizz68



Joined: 26 Jun 2007
Posts: 8

PostPosted: Fri Sep 07, 2007 9:03    Post subject: Reply with quote

resolved, with version 1.08 the problem has not been introduced
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