View previous topic :: View next topic |
Author |
Message |
rpgbl
Joined: 01 Oct 2009 Posts: 30
|
Posted: Mon Aug 16, 2010 14:24 Post subject: Catch and print SQL query error |
|
|
Hi guys,
Im wondering if it is possible to catch the SQL query error and then print it in a conversation during the game.
Im using NWNX4 with mysql. Thank you. |
|
Back to top |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Mon Aug 16, 2010 21:27 Post subject: |
|
|
Code: | if(SQLExecDirect("Your Query Here") == SQL_SUCCESS)
{
//If the query was successful
...
}
else
{
//In case of an error
int nErrno = SQLGetErrno(); //error number as defined in nwnx_mysql_errors.nss
string sError = SQLGetErrorMessage();
...
} |
_________________ In Soviet Russia, NWN plays you! |
|
Back to top |
|
|
rpgbl
Joined: 01 Oct 2009 Posts: 30
|
Posted: Thu Sep 23, 2010 20:21 Post subject: |
|
|
Hi Virusman, thanks for the reply. I just tested it up and an error come up :
ERROR : UNDEFINED IDENTIFIER
Did I miss something here ? Anything I need to change or check ? Thank you. |
|
Back to top |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
|
Back to top |
|
|
|