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 
 
Not sure why code is not working

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



Joined: 22 May 2005
Posts: 6

PostPosted: Sun Dec 11, 2005 19:46    Post subject: Not sure why code is not working Reply with quote

I'm able to put data into my database server with no problems, it just seems to be a matter of getting the data out. I'm currently testing methods of getting the data out and I've been using SendMessageToPC() to try to get to the data...

Code:


#include "aps_include"

void main()
{
    //DEBUG
    object oPC = GetLastUsedBy();
    string player = GetPCPlayerName(oPC);
    string sql = "SELECT PlayerID FROM PLAYER WHERE PlayerName = '" + player + "'";
    string debug;
    string msg;

    SQLExecDirect(sql);

    while(SQLFetch() == SQL_SUCCESS)
    {
        debug = SQLGetData(1);
        msg = "Data from MySQL = " + debug;

    }

    SendMessageToPC(oPC, msg);
}



This doesn't seem to work no matter which way I try it. The data never seems to come back. What am I doing wrong?

Thanks in advance for any help.
Back to top
View user's profile Send private message
cma_dev



Joined: 22 May 2005
Posts: 6

PostPosted: Sun Dec 11, 2005 20:14    Post subject: Reply with quote

I'm not getting a "Sent Response" line in the ODBC log either. Could this be because I am using MySQL 5.0???
Back to top
View user's profile Send private message
cma_dev



Joined: 22 May 2005
Posts: 6

PostPosted: Sun Dec 11, 2005 21:02    Post subject: Reply with quote

Oh I am sooooooo stupid...

I did not use SQLInit() for the mod onload... Rolling Eyes

That did it.

Wink
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