SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 20/05/2012, 12:29 AM   #21
Luis-
High-roller
 
Luis-'s Avatar
 
Join Date: Jan 2010
Location: England
Posts: 3,929
Reputation: 401
Default Re: Using BlueG's MySQL plugin R7 (with cache)

Got it working
__________________


| Home | Server | Forum | Trailer |

Last edited by Luis-; 20/05/2012 at 05:37 PM.
Luis- is offline   Reply With Quote
Old 21/05/2012, 04:28 PM   #22
Vukilore
Huge Clucker
 
Vukilore's Avatar
 
Join Date: Jan 2011
Location: http://forum.sa-mp-fr.com/index.php
Posts: 300
Reputation: 110
Default Re : Using BlueG's MySQL plugin R7 (with cache)

Usefull, thanks
__________________
http://forum.sa-mp-fr.com/index.php. << here rest the french forum, in piece.
Vukilore is offline   Reply With Quote
Old 22/05/2012, 03:26 AM   #23
Sauxe
Banned
 
Join Date: Jan 2012
Posts: 13
Reputation: 0
Default Respuesta: Using BlueG's MySQL plugin R7 (with cache)

Thanks
Sauxe is offline   Reply With Quote
Old 23/05/2012, 07:06 PM   #24
TheArcher
High-roller
 
TheArcher's Avatar
 
Join Date: Dec 2009
Location: Home
Posts: 2,334
Reputation: 251
Default Re: Using BlueG's MySQL plugin R7 (with cache)

Now i better understand R7 functions, thanks for your help.
__________________
TheArcher is offline   Reply With Quote
Old 27/05/2012, 06:08 PM   #25
AShop
Little Clucker
 
Join Date: Feb 2012
Posts: 2
Reputation: 0
Default Re: Using BlueG's MySQL plugin R7 (with cache)

error 017: undefined symbol "dbHandle"
how to fix it?
AShop is offline   Reply With Quote
Old 27/05/2012, 06:19 PM   #26
Luis-
High-roller
 
Luis-'s Avatar
 
Join Date: Jan 2010
Location: England
Posts: 3,929
Reputation: 401
Default Re: Using BlueG's MySQL plugin R7 (with cache)

Define it.
pawn Code:
new dbHandle;
__________________


| Home | Server | Forum | Trailer |
Luis- is offline   Reply With Quote
Old 27/05/2012, 07:16 PM   #27
AndreT
Gangsta
 
AndreT's Avatar
 
Join Date: Jul 2011
Posts: 966
Reputation: 414
Default Re: Using BlueG's MySQL plugin R7 (with cache)

Don't only define it, also create the connection!
pawn Code:
new dbHandle;

// Whereever you connect!
mysql_connect("localhost", "root", "database", "password", 3306);
The port parameter is optional, so in case your MySQL server runs on port 3306, you don't have to specify it:
pawn Code:
mysql_connect("localhost", "root", "database", "password");
I hope the parameter names are self-explanatory. See the plugin's own topic for such documentation. This tutorial actually presumes that the scripter has slight knowledge of how MySQL server works, how the SQL language works and how to implement BlueG's plugin for their server. However if one lacks such knowledge, it is easy to obtain it from one of the several tutorials on this board alone or the official topic once again!

Quote:
Originally Posted by MP2 View Post
Thank you so much for this, I can't begin to explain how grateful I am. Everything seems to be going along nicely now. I haven't really set up the table properly yet as it's early days.

I now understand the purpose of threaded queries, and shouldn't have said the things I said in the mySQL plugin topic!
Thanks, I'm glad you have a hang of it now.
And excuse me for my attitude on a few occasions!

Quote:
Originally Posted by Hiddos View Post
Not bad I guess, thanks for the heads up. Nice to see it forces me using threaded queries, knowing I had to switch over to them a long time ago.
No problem. I don't know if we're alike, but for at least a year or so, and more specifically after starting to learn programming at a university, improvements to coding practices make me a lot happier. Things such as knowing the advantages of threaded queries or code changes like
pawn Code:
if(IsPlayerInAnyVehicle(playerid))
{
    vID = GetPlayerVehicleID(playerid);
}
// to:
vID = GetPlayerVehicleID(playerid);
if(vID != 0)
{
}

Quote:
Originally Posted by Vukilore View Post
Usefull, thanks
Quote:
Originally Posted by Sauxe View Post
Thanks
No problem and good luck scripting!
AndreT is offline   Reply With Quote
Old 27/05/2012, 08:25 PM   #28
ArchBishop
Little Clucker
 
ArchBishop's Avatar
 
Join Date: Oct 2011
Posts: 10
Reputation: 6
Default Re: Using BlueG's MySQL plugin R7 (with cache)

Quote:
Originally Posted by ArchBishop View Post
BlueG: There seem to be server crashes time to time when using %e in mysql_format, the mysql_log.txt prints [15:26:08] CMySQLHandler::EscapeString(SomeGuy); - Escaped 7 characters to SomeGuy. and the callback used with cache=true does not even get triggered.
Hello AndreT, I haven't had any response from BlueG yet, do you perhaps experience crashes when using %e with mysql_format? Especially when using more than 1 time mysql_format quickly behind each other. I have changed all of them back to the normal format and mysql_real_escape_string function and I haven't got ANY crash at all since then.
ArchBishop is offline   Reply With Quote
Old 27/05/2012, 08:43 PM   #29
AndreT
Gangsta
 
AndreT's Avatar
 
Join Date: Jul 2011
Posts: 966
Reputation: 414
Default Re: Using BlueG's MySQL plugin R7 (with cache)

The same happened for me. I had to revert back to using mysql_real_escape_string and then formatting using format(). As far as I know mysql_format serves no other purpose than just making scripters' jobs easier using the same escaping function internally. And an implementation using mysql_real_escape_string in PAWN should not be slower than mysql_format. Also, some might even prefer having their own code written using without such "wrapper" functions.

So it should not be much of a problem, I hope!
AndreT is offline   Reply With Quote
Old 28/05/2012, 08:21 PM   #30
ArchBishop
Little Clucker
 
ArchBishop's Avatar
 
Join Date: Oct 2011
Posts: 10
Reputation: 6
Default Re: Using BlueG's MySQL plugin R7 (with cache)

I currently have an IRC filterscript that connects to the MySQL DB and a gamemode that does the exact same, would this cause any problems? Or could this be easily optimized to only 1 time usage of mysql_connect. As the mysql_log says, it connects and reconnects a second time if I'm correct. The filterscript is designed this to way to directly communicate with the IRC users that used irc commands that I cannot do with a gamemode (irc fs and gamemode should remain seperated but use same MySQL DB).

I have almost no server crashes since I've reverted the mysql_format but now once a while my server seems to hang/freeze for some reason which I didn't have before and my irc filterscript seems to bug out (doesn't respond on irc commands after a while but still echoes the chat from ingame) since I've updated to R7.
ArchBishop 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
[HELP]BlueG's MySQL Plugin R7 [DOG]irinel1996 Scripting Help 0 09/04/2012 07:55 PM
Need help with BlueG's mysql plugin DeathTone Server Support 2 11/03/2012 03:02 AM
MySQL Plugin R5 plugin problem dud Scripting Help 12 05/12/2011 06:28 PM
Strikens Mysql vs BlueG's Mysql plugin PrawkC Scripting Help 4 30/09/2011 10:30 AM
mysql plugin. loading plugin failed ikkentim Help Archive 2 10/02/2011 02:32 PM


All times are GMT. The time now is 12:49 PM.


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