Raised This Month: $12 Target: $400
 3% 

Prepared Statements in Threaded Queries


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
popey456963
Member
Join Date: Mar 2016
Old 03-03-2018 , 07:55   Prepared Statements in Threaded Queries
Reply With Quote #1

Trying to figure out a way of getting a prepared statement to work in a threaded query, is this possible? I have a prepared statement, like:

Code:
hMsgQuery = SQL_PrepareQuery(msgDb, "INSERT INTO msg VALUES (?, ?, ?, ?)", error, sizeof(error));
I also have a connection, as so:

Code:
public void MsgInit() {
	Database.Connect(MsgCallback, "msg");
}
public void MsgCallback(Database db, const char[] error, any data) {
	if (db == null) {
		LogError("Database failure: %s", error);
		return;
	}

	msgDb = db;
}
I can't quite figure out how to get the former to run on the latter though.
popey456963 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 03-03-2018 , 08:18   Re: Prepared Statements in Threaded Queries
Reply With Quote #2

Quote:
Originally Posted by popey456963 View Post
Trying to figure out a way of getting a prepared statement to work in a threaded query, is this possible?
It is not.
__________________
asherkin is offline
popey456963
Member
Join Date: Mar 2016
Old 03-03-2018 , 08:31   Re: Prepared Statements in Threaded Queries
Reply With Quote #3

Oh, such a shame
popey456963 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:20.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode