Problem with BlueG MySQL plugin.
#1

I am testing out BlueG's MySQL plugin, but for some reason, even though I included the latest a_mysql (R7, same for plugin), I get the following errors :

Код:
sqltest.pwn(39) : error 017: undefined symbol "mysql_query"
Here's my code :

pawn Код:
#include <a_samp>
#include <a_mysql>

[...]

public OnFilterScriptInit()
{
    mysql_debug(1);

    new mysql = mysql_connect("127.0.0.1","root","samp","");
    mysql_query("FLUSH PRIVILEGES"); // LINE 39
    mysql_close();
   
    return 1;
}
Also tried specifying the Handle : mysql_query("FLUSH PRIVILEGES", mysql), and threaded queries, still nothing.

Anyone knows what's wrong in here?
Thanks for your time
Reply
#2

Maybe your "mysql.inc" is corrupted, try to download a new version!
Reply
#3

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
Maybe your "mysql.inc" is corrupted, try to download a new version!
I have the latest a_mysql.inc and mysql.dll (and libmysql.dll) versions, got them from here : http://files.g-stylezzz.com/mysql/re...-win32_vs9.rar (Official source)

This is what I did, step by step :
  1. Downloaded MySQL Plugin R7
  2. Unzipped the rar
  3. Copied a_mysql.inc into pawno/include
  4. Copied mysql.dll into plugins
  5. Copied libmysql.dll into server root
  6. Opened PAWNO (From that specific server folder)
  7. Made a new FS using the premade model
  8. Inserted #include <a_mysql> under a_samp
  9. Performed the code that I provided in the first post
As far as I know, I haven't missed any steps so far, got the latest plugin/include release, i'm running the proper pawno linked to that specific pawno/include folder, and i'm using an example provided in the wiki.

Really can't understand PAWN's logic ..

[EDIT]

I am a beginner in PAWN scripting, but no need to be an expert to know that this :

pawn Код:
#define mysql_query(%1,%2,%3,%4) \
    mysql_function_query(%4, %1, false, "OnQueryFinish", "siii", %1, %2, %3, %4)
Is not good, at all, specially when your documentation says this :

Код:
query[]	The query you want to process.
resultid	Optional (if you specify this query will be processed in a separate thread).
extraid	Optional (extra variable that would be processed to the callback.
connectionHandle	The connection handle this will be processed on.
Apparently, those are definitely not optional.

He might be too busy to update his documentation, I guess.
Reply
#4

The old mysql_query was changed to support threaded queries. Use myqsl_function_query instead, or use the older myqsl plugins. It's recommended you thread all your queries though.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)