SA-MP Forums Archive
[Plugin] [REL] MySQL Plugin (Now on github!) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Plugin Development (https://sampforum.blast.hk/forumdisplay.php?fid=18)
+--- Thread: [Plugin] [REL] MySQL Plugin (Now on github!) (/showthread.php?tid=56564)



[REL] MySQL Plugin (Now on github!) - BlueG - 29.11.2008

MySQL Plugin
The best and most famous MySQL plugin for SA:MP out there!
Code:
10/12/2013:
The project has been moved from ******code to github
This plugin allows you to use MySQL in PAWN. It's currently being developed by Pain123/maddinat0r; you'll find all older versions, including source codes and sample scripts, from R5 to R7 at the bottom of this post and the latest release here.


Project home
Latest changes
Source Code
Downloads
Wiki (Version >= R33)


How to install:


Move mysql.dll (windows) or mysql.so (linux) to your 'plugins/' directory. On windows you'll have to download the mysql library (libmysql.dll, see downloads) and move it to your main server directory. The server configuration (server.cfg) has to be edited aswell.
PAWN Scripting R5-R7: (a_mysql.inc)

Compiling Notes:
Downloads: (for newer updates, use the github project site above!)

NOTE: DON'T USE VERSION R7 OR ABOVE IF YOU HAVE NO IDEA WHAT THREADING MEANS OR HOW IT WORKS. YOU MIGHT HARM YOUR SERVER WHEN USING IT NOT PROPERLY.
Thanks to:
If you have any questions, post them here!



Re: [REL] Alternative MySQL Plugin (+example PAWN/PHP script) - JaTochNietDan - 29.11.2008

Good job GStylezzz


Re: [REL] Alternative MySQL Plugin (+example PAWN/PHP script) - Bardokas - 29.11.2008

Need something better to get values. It would be great to have mysql_get_field() or c_strtok() like in [RAZ]ADreNaLiNe-DJ plugin are.


Re: [REL] Alternative MySQL Plugin (+example PAWN/PHP script) - BlueG - 30.11.2008

Quote:
Originally Posted by Bardokas
Need something better to get values. It would be great to have mysql_get_field() or c_strtok() like in [RAZ]ADreNaLiNe-DJ plugin are.
There is already a strtok function in PAWN.'mysql_fetch_row' returns like the following format if you selected more than one row in the query:

row1 row2 row3

Now you can just use strtok to split it in tokens.Also 'mysql_get_field' is probably a good idea for the next version.


Re: [REL] Alternative MySQL Plugin (+example PAWN/PHP script) - Bardokas - 30.11.2008

I know strtok function in PAWN, but in C i think it will be faster?


Re: [REL] Alternative MySQL Plugin (+example PAWN/PHP script) - Meester Proper - 01.12.2008

hey

does the memory deallocation work here correctly?


Re: [REL] Alternative MySQL Plugin (+example PAWN/PHP script) - Balon - 01.12.2008

I think so. The code is much cleaner here and I hadn't any problems with this plugin on Debian 4.0 ETCH.


Re: [REL] Alternative MySQL Plugin (+example PAWN/PHP script) - Extremo - 01.12.2008

Somebody is finally adding some more stuff to mysql, great job!


Re: [REL] Alternative MySQL Plugin (+example PAWN/PHP script) - Yaheli_Faro - 01.12.2008

Do I have to know PHP to make a page that shows user stats online?


Re: [REL] Alternative MySQL Plugin (+example PAWN/PHP script) - JaTochNietDan - 01.12.2008

Quote:
Originally Posted by Yaheli
Do I have to know PHP to make a page that shows user stats online?
Yes, quite limited PHP though, I thought it was hard at first but after going through other Control Panels code its actually quite easy going to PHP from some PAWN knowledge.


Re: [REL] Alternative MySQL Plugin (+example PAWN/PHP script) - Yaheli_Faro - 01.12.2008

Quote:
Originally Posted by JaTochNietDan
Quote:
Originally Posted by Yaheli
Do I have to know PHP to make a page that shows user stats online?
Yes, quite limited PHP though, I thought it was hard at first but after going through other Control Panels code its actually quite easy to match PHP + SA-MP
Hm... you have anything good I can learn from?


Re: [REL] Alternative MySQL Plugin (+example PAWN/PHP script) - JaTochNietDan - 01.12.2008

Quote:
Originally Posted by Yaheli
Quote:
Originally Posted by JaTochNietDan
Quote:
Originally Posted by Yaheli
Do I have to know PHP to make a page that shows user stats online?
Yes, quite limited PHP though, I thought it was hard at first but after going through other Control Panels code its actually quite easy to match PHP + SA-MP
Hm... you have anything good I can learn from?
Well you need to learn some basic SQL first, I thought it was very hard but after I got into it and a bit of help from G-Stylezzz its quite easy. Then once you know some basic SQL just download Los Santos Next Episodes control panel by G-Stylezz and take a look at how he integrates user stats etc. Its a bit of a learning curve but its worth learning.


Re: [REL] Alternative MySQL Plugin (+example PAWN/PHP script) - Yaheli_Faro - 01.12.2008

Quote:
Originally Posted by JaTochNietDan
Quote:
Originally Posted by Yaheli
Quote:
Originally Posted by JaTochNietDan
Quote:
Originally Posted by Yaheli
Do I have to know PHP to make a page that shows user stats online?
Yes, quite limited PHP though, I thought it was hard at first but after going through other Control Panels code its actually quite easy to match PHP + SA-MP
Hm... you have anything good I can learn from?
Well you need to learn some basic MySQL first, I thought it was very hard but after I got into it and a bit of help from G-Stylezzz its quite easy. Then once you know some basic MySQL just download Los Santos Next Episodes control panel by G-Stylezz and take a look at how he integrates user stats etc. Its a bit of a learning curve but its worth learning.
And i'm guessing that to learn basic MySQL I need to go to their webpage?


Re: [REL] Alternative MySQL Plugin (+example PAWN/PHP script) - JaTochNietDan - 01.12.2008

Quote:
Originally Posted by Yaheli
Quote:
Originally Posted by JaTochNietDan
Quote:
Originally Posted by Yaheli
Quote:
Originally Posted by JaTochNietDan
Quote:
Originally Posted by Yaheli
Do I have to know PHP to make a page that shows user stats online?
Yes, quite limited PHP though, I thought it was hard at first but after going through other Control Panels code its actually quite easy to match PHP + SA-MP
Hm... you have anything good I can learn from?
Well you need to learn some basic MySQL first, I thought it was very hard but after I got into it and a bit of help from G-Stylezzz its quite easy. Then once you know some basic MySQL just download Los Santos Next Episodes control panel by G-Stylezz and take a look at how he integrates user stats etc. Its a bit of a learning curve but its worth learning.
And i'm guessing that to learn basic MySQL I need to go to their webpage?
http://www.w3schools.com/PHP/php_mysql_intro.asp

That is an extremely good website for learning ANYTHING!


Re: [REL] Alternative MySQL Plugin (+example PAWN/PHP script) - rafay - 02.12.2008

OMG! A ready made php script! :O
Respect man! thx

EDIT: FFS, I cant see the download button --..--


Re: [REL] Alternative MySQL Plugin (+example PAWN/PHP script) - Yaheli_Faro - 02.12.2008

Quote:
Originally Posted by Rafay
OMG! A ready made php script! :O
Respect man! thx

EDIT: FFS, I cant see the download button --..--
It isn't exactly a ready made php script, theres lots of work to do... (Which I am having trouble understanding )


Re: [REL] Alternative MySQL Plugin (+example PAWN/PHP script) - rafay - 02.12.2008

Quote:
Originally Posted by Yaheli
Quote:
Originally Posted by Rafay
OMG! A ready made php script! :O
Respect man! thx

EDIT: FFS, I cant see the download button --..--
It isn't exactly a ready made php script, theres lots of work to do... (Which I am having trouble understanding )
& i can't even download it!
Somebody upload it to somewhere please.!


Re: [REL] Alternative MySQL Plugin (+example PAWN/PHP script) - FrankZZ - 02.12.2008

When I execute a SELECT query, selecting multiple rows, and I call the mysql_fetch_row function, the server crashes.
though it does not when i limit the results to 1 row..


Re: [REL] Alternative MySQL Plugin (+example PAWN/PHP script) - JaTochNietDan - 02.12.2008

Quote:
Originally Posted by Rafay
Quote:
Originally Posted by Yaheli
Quote:
Originally Posted by Rafay
OMG! A ready made php script! :O
Respect man! thx

EDIT: FFS, I cant see the download button --..--
It isn't exactly a ready made php script, theres lots of work to do... (Which I am having trouble understanding )
& i can't even download it!
Somebody upload it to somewhere please.!
What script?


Re: [REL] Alternative MySQL Plugin (+example PAWN/PHP script) - Ycto - 02.12.2008

Hai!

Nice work on the plugin!

@ Yaheli: You can take a look at SAMPSt's php files.You can learn quite a lot out of these. Link: http://forum.sa-mp.com/index.php?topic=23380.0