18.05.2012, 19:29
R7 is actually a good update and it is nice to see people write new modes using it or convert old modes to use it.
Simply leave the callback and specifiers string empty, pass them as "", since mysql_function_query does not have these as optional parameters. There's an example for this in the first post:
INSERT query behaves the same way.
And also, a small question/suggestion - why don't you use AUTO INCREMENT for your users? This would give each of your users an unique database ID that you could use in various cases, but it has the best use when you have other tables, for example `houses` where the owner of your house can simply be set as the unique value of player.
This is purely to maintain backwards compatibility for scripters that still use the OnQueryFinish callback. It has a predefined set of variables that are sent to OnQueryFinish and this already gives us 2 reasons why not to use it:
1. It is one callback only. This does not provide possibilities for one to divide their code between numerous files or various sections of file without creating a link in OnQueryFinish.
2. It cannot pass extra variables to the callback. You only have the player ID and an "extra ID" in this callback as far as I know.
As for the syntax, however, look up mysql_query behavior in R6-2 - it is similar and produces similar results. However I seriously tell you not to use it since you are writing a new mode as I saw from another post of yours. The new capabilities provide more flexibility.
Read the tutorial and ask for help
Quote:
Originally Posted by MP2
If I don't want a callback to be called, for example an INSERT query for registration, what do I put as the callback and stuff in mysql_function_query?
|
Quote:
Originally Posted by AndreT
pawn Code:
|
And also, a small question/suggestion - why don't you use AUTO INCREMENT for your users? This would give each of your users an unique database ID that you could use in various cases, but it has the best use when you have other tables, for example `houses` where the owner of your house can simply be set as the unique value of player.
Quote:
I found this in a_mysql.inc pawn Code:
|
1. It is one callback only. This does not provide possibilities for one to divide their code between numerous files or various sections of file without creating a link in OnQueryFinish.
2. It cannot pass extra variables to the callback. You only have the player ID and an "extra ID" in this callback as far as I know.
As for the syntax, however, look up mysql_query behavior in R6-2 - it is similar and produces similar results. However I seriously tell you not to use it since you are writing a new mode as I saw from another post of yours. The new capabilities provide more flexibility.
Quote:
Originally Posted by kikito
Never understood the R7 version, is annoying for the update.
|