diff options
author | shennetsind <notind@gmail.com> | 2013-06-10 17:53:37 -0700 |
---|---|---|
committer | shennetsind <notind@gmail.com> | 2013-06-10 17:53:37 -0700 |
commit | 8821ff87533b037d5d4914db6dbdeacfa5fca4ce (patch) | |
tree | 5fd975f4501e8d71ff1b5b31d66a6b99bc813927 /src/char/int_mail.c | |
parent | 8f85487dbdc1a5f4bd3d01bc3fc75bba9b643124 (diff) | |
parent | 4d9a0a869c52f7acab6ca110d78aa006f76f70a5 (diff) | |
download | hercules-8821ff87533b037d5d4914db6dbdeacfa5fca4ce.tar.gz hercules-8821ff87533b037d5d4914db6dbdeacfa5fca4ce.tar.bz2 hercules-8821ff87533b037d5d4914db6dbdeacfa5fca4ce.tar.xz hercules-8821ff87533b037d5d4914db6dbdeacfa5fca4ce.zip |
Merge pull request #42 from Earisu/master
Sql Statement interface
Diffstat (limited to 'src/char/int_mail.c')
-rw-r--r-- | src/char/int_mail.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/char/int_mail.c b/src/char/int_mail.c index 9181b7db6..e4b88b5bf 100644 --- a/src/char/int_mail.c +++ b/src/char/int_mail.c @@ -122,20 +122,20 @@ int mail_savemessage(struct mail_message* msg) dbUpdateUid(sql_handle); // prepare and execute query - stmt = SqlStmt_Malloc(sql_handle); - if( SQL_SUCCESS != SqlStmt_PrepareStr(stmt, StrBuf->Value(&buf)) - || SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_STRING, msg->send_name, strnlen(msg->send_name, NAME_LENGTH)) - || SQL_SUCCESS != SqlStmt_BindParam(stmt, 1, SQLDT_STRING, msg->dest_name, strnlen(msg->dest_name, NAME_LENGTH)) - || SQL_SUCCESS != SqlStmt_BindParam(stmt, 2, SQLDT_STRING, msg->title, strnlen(msg->title, MAIL_TITLE_LENGTH)) - || SQL_SUCCESS != SqlStmt_BindParam(stmt, 3, SQLDT_STRING, msg->body, strnlen(msg->body, MAIL_BODY_LENGTH)) - || SQL_SUCCESS != SqlStmt_Execute(stmt) ) + stmt = SQL->StmtMalloc(sql_handle); + if( SQL_SUCCESS != SQL->StmtPrepareStr(stmt, StrBuf->Value(&buf)) + || SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_STRING, msg->send_name, strnlen(msg->send_name, NAME_LENGTH)) + || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, msg->dest_name, strnlen(msg->dest_name, NAME_LENGTH)) + || SQL_SUCCESS != SQL->StmtBindParam(stmt, 2, SQLDT_STRING, msg->title, strnlen(msg->title, MAIL_TITLE_LENGTH)) + || SQL_SUCCESS != SQL->StmtBindParam(stmt, 3, SQLDT_STRING, msg->body, strnlen(msg->body, MAIL_BODY_LENGTH)) + || SQL_SUCCESS != SQL->StmtExecute(stmt) ) { SqlStmt_ShowDebug(stmt); msg->id = 0; } else - msg->id = (int)SqlStmt_LastInsertId(stmt); + msg->id = (int)SQL->StmtLastInsertId(stmt); - SqlStmt_Free(stmt); + SQL->StmtFree(stmt); StrBuf->Destroy(&buf); return msg->id; |