Still battling
#1

I'm still battling to get the hang of this
I'm using Blue's MySQL Script and trying run this:
Код:
format(query, sizeof(query), "SELECT * FROM `SAMP` WHERE `playername` LIKE '%s' LIMIT 0 , 30", pname);
	new connection = mysql_connect(SQL_HOST,SQL_USER,SQL_DB,SQL_PASS);
	mysql_query(query, connection);
	mysql_store_result(connection);
	printf("%i",mysql_num_rows(connection));
	mysql_free_result(connection);
when I run it, it is giving me:
Quote:

[23:01:32] CMySQLHandler::StoreResult() - No data to store.

In the debug

Does anyone possibly know why or what I'm doing wrong?
Reply
#2

Try run the query through phpMyAdmin or another interface to confirm it's valid or returns any results at all.
Reply
#3

Already tried, query runs 100% through CMD.
Reply
#4

Connection handle should be the last parameter of mysql_query, right now it's interpretting 'connection' as the resultid.

This should be right:
pawn Код:
mysql_query(query, 0, 0, connection);
Reply
#5

I'm still getting

Quote:

"[23:57:19] CMySQLHandler::StoreResult() - No data to store."

Though from the Query I'm getting
Quote:

[23:57:19] CMySQLHandler::Query(resultID) - Threaded query with id 0 started. (Extra ID: 0)

Which I guess is fine, right?
Reply
#6

It just means your query is being executed through a thread, which actually works out better for the server.

Do you connect and close every time you need to? It's better to just keep 1 active connection constantly.
Reply
#7

I've set the connect function to be executed once and the variable that is set to the connect is a global one, still exact same errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)