From ba8b63be4b9d4df2a9f52bbf655e3ad5c3bf3b1c Mon Sep 17 00:00:00 2001 From: Susu Date: Mon, 10 Jun 2013 13:52:32 +0200 Subject: Added SqlStmt functions to the SQL interface --- src/char/int_mail.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/char/int_mail.c') 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; -- cgit v1.2.3-60-g2f50