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 
 
Valid SELECT returning no results in NWNX

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



Joined: 06 Dec 2006
Posts: 152

PostPosted: Fri Apr 13, 2007 10:35    Post subject: Valid SELECT returning no results in NWNX Reply with quote

Hello,

I got a weird problem, and I probably just miss something incredibly obvious....

I have a table that contains a few records that I want to retreive in NWN1. I use NWNX2. I made a simple SELECT statement which I retreive with the usual While loop.

Code:
sQuery = "SELECT * from TableName";

SendMessageToPC( oPC, sQuery );

SQLExecDirect(sQuery );

if ( SQLFetch() == SQL_SUCCESS ) {

     SendMessageToPC( oPC, "Result: "+ SQLGetData(1)  );
}


The weird thing is that I don't get any results, although the query is valid when used in PHPMyAdmin. I copy it straight from the chatlogfile, NWNX log doesn't give me any OBDC errors, and SQLFetch() really doesn't return SQL_SUCCESS. I also tried returning just one row without the While loop, still no go.

Writing and updating records works fine in the same script.

No clue what's wrong, but maybe someone else ran into this before. I managed to retreive data before (in another module, though).
Back to top
View user's profile Send private message
Disco



Joined: 06 Dec 2006
Posts: 152

PostPosted: Fri Apr 13, 2007 22:03    Post subject: Reply with quote

Found it. NWNX doesn't react the same to invalid indexes as PHP SQL does.
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