Posts: 845
Threads: 3
Joined: Jun 2010
Yep, I'll change the message.
Has anyone any other suggestions? R27 has now y_inline support, but only this as feature seems quite boring.
A preview:
pawn Code:
public OnPlayerConnect(playerid) {
inline Test2(d1, d2) {
new
Rows,
Fields;
cache_get_data(Rows, Fields, SQL);
printf("Rows: %d; Fields: %d", Rows, Fields);
}
mysql_tquery_inline(SQL, Query, using inline Test2, "dd", 22, 42);
return 1;
}
Posts: 845
Threads: 3
Joined: Jun 2010
Are any errors or warnings logged?
Posts: 368
Threads: 24
Joined: Feb 2012
Quote:
Originally Posted by Pain123
Yep, I'll change the message.
Has anyone any other suggestions? R27 has now y_inline support, but only this as feature seems quite boring.
A preview:
pawn Code:
public OnPlayerConnect(playerid) { inline Test2(d1, d2) { new Rows, Fields; cache_get_data(Rows, Fields, SQL); printf("Rows: %d; Fields: %d", Rows, Fields); }
mysql_tquery_inline(SQL, Query, using inline Test2, "dd", 22, 42); return 1; }
|
This looks like non-threaded, will it benefit performance in any way? Or just be easier to use?
Posts: 368
Threads: 24
Joined: Feb 2012
Quote:
Originally Posted by KyleSmith
It isn't, I thought it was too.
Basically it just allows the callback to be put in the function where you call the query.
|
Its called exactly from inline is used?
Posts: 53
Threads: 4
Joined: Jun 2013
Reputation:
0
24.06.2013, 11:18
(
Last edited by magnusburton; 29/06/2013 at 11:08 AM.
)
This might look like a noob-question but I get the error error 017: undefined symbol "mysql_query_callback" and in the include there's this define which uses the mysql_function_query() function which leads to the question - what causes this error?
Posts: 845
Threads: 3
Joined: Jun 2010
I removed that define is a previous revision, what version are you using? (R8, R14, ...)
And why don't you just use mysql_function_query?
Posts: 156
Threads: 25
Joined: Jun 2013
Reputation:
0
I cant load it, it says This application has failed to start because LIBMYSQL.dll was not found. PLEASE HELP?
Posts: 365
Threads: 97
Joined: Aug 2010
Reputation:
0
libmysql.dll is located on the exact same page from which you've downloaded the plugin. You can find it at the end of the first post, too.
Posts: 213
Threads: 16
Joined: Mar 2012
Reputation:
0
I'm using mysql r7 and the server crashes when using mysql_ping(), mysql_format() and mysql_stats().
Also, when I restart my server there are a lot of players connecting in less than one minute (200-300) so there are a lot of queryes that are executed (to check passwords, bans and stuff). When that happens, sometimes the players get the login box twice (the login box appears at the end of a query), some don't get it at all. That only happens after the server starts and there are a lot of players connecting so I think that there's a problem with the plugin and not with my gamemode .
I'm planning to use a timer and let x number of players connect every minute and have the rest of them wait for a minute or two if this problem can't be solved by upgrading to mysql r8.
Is mysql R8 solving any of those problems?
Is mysql R8 as stable as mysql R7?
Posts: 845
Threads: 3
Joined: Jun 2010
Why not upgrading to R26? It seems pretty stable and has AFAIK no bugs in it. It's also way faster than R7 or R8.
Is it MySQL R8 or MySQL R7 REV 26? Pretty confused.
Posts: 845
Threads: 3
Joined: Jun 2010
Quote:
Originally Posted by im
Upgraded to r26 today. Same problem.
|
I tried to reproduce this with sending a big query 1000 times and fetching the result with 2 different methods. Every time the callback was called once. If this would be a problem with the plugin there would be far more complaints. So it's likely a problem with your gamemode or server (maybe huge lags? 200-300 players shouldn't cause a too big lag). Try optimizing your gamemode, like sending only one query per player to load data, for example
PHP Code:
SELECT a.*, b.* FROM players AS a, inventory AS b WHERE a.ID = b.PID AND a.ID = '3'
instead of multiple queries to load data out of different tables.
Posts: 767
Threads: 40
Joined: Dec 2011
Reputation:
0
When i use "AS" in a query in which var will be the result?
Posts: 845
Threads: 3
Joined: Jun 2010
pawn Code:
cache_get_field_content_int(0, "ID");
will give you the ID of field 'a.ID'. If there is a field in table b with the same name you will always get only one result (most likely the one from the first table, in our example this would be 'players'). The only solution is to rename the field directly in the table or to use an alias in the query:
PHP Code:
SELECT a.ID AS IDa, b.ID AS IDb FROM ...