Mysql help needed ! fast :(
#1

Hey, so im a scripter of a RP server with mysql, i got the gamemode, installed the plugin but i get 25 of these errors.

Код:
C:\Users\Ilmar\Desktop\GM\gamemodes\downtown.pwn(2704) : error 017: undefined symbol "mysql_query"
Really need help, dont know what to do.
Reply
#2

if you are using mysql version r7 of BlueG the new comand is mysql_function_query , not mysql_query !

Here is a tutorial: https://sampforum.blast.hk/showthread.php?tid=337810


pawn Код:
mysql_function_query(dbHandle, "SELECT ... FROM ...", true, "OnQueryFinished", "siii", "Andre", 1, 2, 3);
forward OnQueryFinished(name[], number_1, number_2, number_3);
public OnQueryFinished(name[], number_1, number_2, number_3)
{
    printf("Data: %s %i %i %i", name, number_1, number_2, number_3);
    // will print: Andre 1 2 3
}
But you can use this to:

pawn Код:
mysql_function_query(dbHandle, "SELECT ... FROM ...", true, "", "");
If you don't want something to be executed after mysql query or to send data etc ... i recomand you that tutorial
Reply
#3

i dont understand, what do i write then ?
Reply
#4

With mysql_function_query, you can use the callback parameter. It means, the callback YOU HAVE SPECIFIED will be called as the query will be executed! So you can do awesome things with it.
pawn Код:
mysql_function_query("SELECT ... FROM ...", true, "OnQueryFinished", "s", "Some string parameter");
pawn Код:
forward OnQueryFinished(somestring[]);
public OnQueryFinished(somestring[])
{
    printf("Data: %s", somestring);
return 1;
}
This should print "Some string parameter".
Reply
#5

But i have the querry like this..

mysql_query(query);

Really, i dont understand anything right now ...
Reply
#6

So just use it like this!
pawn Код:
mysql_function_query(query, true, "", "");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)