SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 06/03/2013, 10:32 AM   #1
Hade.
Huge Clucker
 
Hade.'s Avatar
 
Join Date: Oct 2012
Location: Tallinn, Estonia
Posts: 210
Reputation: 16
Default Mysql help needed ! fast :(

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.

Code:
C:\Users\Ilmar\Desktop\GM\gamemodes\downtown.pwn(2704) : error 017: undefined symbol "mysql_query"
Really need help, dont know what to do.
__________________
Hade. is offline   Reply With Quote
Old 06/03/2013, 10:34 AM   #2
shady001
Big Clucker
 
Join Date: Sep 2011
Location: Europe
Posts: 89
Reputation: 0
Default Re: Mysql help needed ! fast :(

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

Here is a tutorial: http://forum.sa-mp.com/showthread.php?t=337810


pawn Code:
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 Code:
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
shady001 is offline   Reply With Quote
Old 06/03/2013, 10:56 AM   #3
Hade.
Huge Clucker
 
Hade.'s Avatar
 
Join Date: Oct 2012
Location: Tallinn, Estonia
Posts: 210
Reputation: 16
Default Re: Mysql help needed ! fast :(

i dont understand, what do i write then ?
__________________
Hade. is offline   Reply With Quote
Old 06/03/2013, 11:03 AM   #4
RajatPawar
High-roller
 
RajatPawar's Avatar
 
Join Date: Aug 2011
Location: ヽ༼ຈل͜ຈ༽ノ
Posts: 2,179
Reputation: 311
Default Re: Mysql help needed ! fast :(

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 Code:
mysql_function_query("SELECT ... FROM ...", true, "OnQueryFinished", "s", "Some string parameter");
pawn Code:
forward OnQueryFinished(somestring[]);
public OnQueryFinished(somestring[])
{
    printf("Data: %s", somestring);
return 1;
}
This should print "Some string parameter".
RajatPawar is offline   Reply With Quote
Old 06/03/2013, 11:05 AM   #5
Hade.
Huge Clucker
 
Hade.'s Avatar
 
Join Date: Oct 2012
Location: Tallinn, Estonia
Posts: 210
Reputation: 16
Default Re: Mysql help needed ! fast :(

But i have the querry like this..

mysql_query(query);

Really, i dont understand anything right now ...
__________________
Hade. is offline   Reply With Quote
Old 06/03/2013, 11:07 AM   #6
RajatPawar
High-roller
 
RajatPawar's Avatar
 
Join Date: Aug 2011
Location: ヽ༼ຈل͜ຈ༽ノ
Posts: 2,179
Reputation: 311
Default Re: Mysql help needed ! fast :(

So just use it like this!
pawn Code:
mysql_function_query(query, true, "", "");
RajatPawar is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mysql problem [Fast] Niekshyto Scripting Help 4 26/12/2012 04:53 PM
A little help needed fast.Please. TaLhA XIV Scripting Help 0 06/08/2012 08:51 PM
Help needed fast pleaseeeeee! :( Ersin1 Server Support 13 10/07/2009 10:44 PM
MOVED: Help needed fast pleaseeeeee! :( kaisersouse Help Archive 0 15/06/2009 09:53 PM


All times are GMT. The time now is 05:17 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.