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)



Re: [REL] MySQL Plugin (Now on github!) - fonia5 - 28.12.2014

can anybody give me a link to the mysql r7 windows please.


Re: [REL] MySQL Plugin (Now on github!) - Aliassassin123456 - 28.12.2014

I Love ****** :\

R6:
http://www.solidfiles.com/d/a96c367d03/MYSQLR6.rar

R7:
Quote:
Originally Posted by Alex Magaсa
Посмотреть сообщение
There is no one to answer to my question
i am using mysql_tquery now, but speed is now like a turtle


Respuesta: [REL] MySQL Plugin (Now on github!) - CoR3 - 28.12.2014

Hello, i use R5, and i have this problem (i have Debian VPS)
Quote:

[19:21:01] Loading plugin: mysql.so
[19:21:01] Failed (libssl.so.6: cannot open shared object file: No such file or directory)

Do you know how to fix it?... Help me.


Re: Respuesta: [REL] MySQL Plugin (Now on github!) - NLFMaster - 28.12.2014

Quote:
Originally Posted by CoR3
Посмотреть сообщение
Hello, i use R5, and i have this problem (i have Debian VPS)

Do you know how to fix it?... Help me.
Upload the libssl.so file into your servers folder.


Respuesta: Re: [REL] MySQL Plugin (Now on github!) - CoR3 - 28.12.2014

Quote:
Originally Posted by Abagail
Посмотреть сообщение
That plug-in version is not supported. Upgrade your script to use a supported version such as R39-2.
i change the version for r39-2, and when i compiled it show me some errors, i think that some functions change, and i have to change some lines... the problem is....

change mysql_store_result for ??
change mysql_num_rows for ?
change mysql_free_result for ?
change mysql_fetch_row for ?

Help me please.


Re: [REL] MySQL Plugin (Now on github!) - Abagail - 28.12.2014

Quote:
Originally Posted by fonia5
Посмотреть сообщение
can anybody give me a link to the mysql r7 windows please.
Here you go!
INCLUDE(View in Browser)
INCLUDE(Direct Download)

Plugins:
Windows: DOWNLOAD
Linux: DOWNLOAD

Your welcome!


Re : [REL] MySQL Plugin (Now on github!) - Baltimore - 31.12.2014

Hello !

I use MySQL R39-2.

My cache_insert_id return 0.

pawn Код:
mysql_format(MySQLConnect, query, 1024, "INSERT INTO `vehs` (`ModelID`, `PosX`, `PosY`, `PosZ`, `PosA`, `Couleur1`, `Couleur2`) VALUES (%d, '%f', '%f', '%f', '%f', %d, %d)", VehInfo[entry][ModelID], VehInfo[entry][Pos][0], VehInfo[entry][Pos][1], VehInfo[entry][Pos][2], VehInfo[entry][Pos][3], couleur1, couleur2);

mysql_tquery(MySQLConnect, query);

printf("%d", cache_insert_id());
Return 0 :/

Can u help me?


Re: [REL] MySQL Plugin (Now on github!) - Michalec - 31.12.2014

Код:
mysql_format(MySQLConnect, query, 1024, "INSERT INTO `vehs` (`ModelID`, `PosX`, `PosY`, `PosZ`, `PosA`, `Couleur1`, `Couleur2`) VALUES (%d, '%f', '%f', '%f', '%f', %d, %d)", VehInfo[entry][ModelID], VehInfo[entry][Pos][0], VehInfo[entry][Pos][1], VehInfo[entry][Pos][2], VehInfo[entry][Pos][3], couleur1, couleur2);

mysql_tquery(MySQLConnect, query, "ReturnCallback", "");

forward ReturnCallback();
public ReturnCallback()
{
printf("%d", cache_insert_id());
}
Your're using threaded queries! You have to specify callback to get your data's.


Re: [REL] MySQL Plugin (Now on github!) - $$inSane - 31.12.2014

Umm, i have few questions (not releated to mysql totaly):
1. Is mysql faster than sqlite?
2. Does mysql uses less memory than sqlite??
3. Well, can i use sql browser to explore the mysql table

OT: Can it be possible to read and write INI files from web, PHP stuff?
If yes, please PM me with a solution that actually works. I literally need it!


Re: [REL] MySQL Plugin (Now on github!) - Vince - 31.12.2014

  1. Depends on the query.
  2. No, more.
  3. No. Most people use phpMyAdmin but there are stand-alone tools like MySQL Workbench.
Yes, PHP can read and parse ini files relatively simple, but if you need to retrieve those files from an external server then it becomes more difficult because you will first need to copy those files to your local server via the FTP functions in PHP. Don't ask me how to do that, I've never tried.

---

On another note, I would very much like to see better internal handling of NULL values. If a NULL value appears in a non-string column and you try to retrieve it with the _int or _float functions you will get errors. Maybe add another optional parameter to cache_get_row_int and cache_get_row_float that allows the user to specify a default value should the field be NULL.

I know you can use IFNULL in the query to circumvent the problem, but if you have a lot of fields that can be NULL then it can significantly lengthen the query. Especially if you also want to add an alias for use with the cache_get_field_content functions.


Re: [REL] MySQL Plugin (Now on github!) - iLuXing - 31.12.2014

@Vince.

Firstly I have to thank you for replying my other post yet.

Hello, I have a Chinses character problem.

I have a string data (like "你好" in English is "hello")that stored by Mysql and I use this plugin.

I get this content via mysql plugin, and I just print it on my Console, it show me "" not "你好".
so I decided test SendClientMessage this string that contains some Chinses character that samp-server.exe console showed "', the server crashed....

Sorry I dont know what make it a problem , Mysql plugin ? or PAWN.

Can you tell me how to fix it or whats this problem is.

THANK YOU.


Re : [REL] MySQL Plugin (Now on github!) - Baltimore - 31.12.2014

Quote:
Originally Posted by Michalec
Посмотреть сообщение
Код:
mysql_format(MySQLConnect, query, 1024, "INSERT INTO `vehs` (`ModelID`, `PosX`, `PosY`, `PosZ`, `PosA`, `Couleur1`, `Couleur2`) VALUES (%d, '%f', '%f', '%f', '%f', %d, %d)", VehInfo[entry][ModelID], VehInfo[entry][Pos][0], VehInfo[entry][Pos][1], VehInfo[entry][Pos][2], VehInfo[entry][Pos][3], couleur1, couleur2);

mysql_tquery(MySQLConnect, query, "ReturnCallback", "");

forward ReturnCallback();
public ReturnCallback()
{
printf("%d", cache_insert_id());
}
Your're using threaded queries! You have to specify callback to get your data's.

Hello !

If I have 3 vehicles (For exemple) the cache_insert_id it's good!

But, if i restart my serveur.. And I buy a new vehicle... The cache_insert_id it's 1.. While it should be 4...


Re: [REL] MySQL Plugin (Now on github!) - $$inSane - 01.01.2015

Quote:
Originally Posted by Vince
Посмотреть сообщение
  1. Depends on the query.
  2. No, more.
  3. No. Most people use phpMyAdmin but there are stand-alone tools like MySQL Workbench.
Yes, PHP can read and parse ini files relatively simple, but if you need to retrieve those files from an external server then it becomes more difficult because you will first need to copy those files to your local server via the FTP functions in PHP. Don't ask me how to do that, I've never tried.

---

On another note, I would very much like to see better internal handling of NULL values. If a NULL value appears in a non-string column and you try to retrieve it with the _int or _float functions you will get errors. Maybe add another optional parameter to cache_get_row_int and cache_get_row_float that allows the user to specify a default value should the field be NULL.

I know you can use IFNULL in the query to circumvent the problem, but if you have a lot of fields that can be NULL then it can significantly lengthen the query. Especially if you also want to add an alias for use with the cache_get_field_content functions.
Thanks, that helped me!


Re: [REL] MySQL Plugin (Now on github!) - MythicalMarauder - 02.01.2015

What's up with the links? They show forbidden for me.


Re: [REL] MySQL Plugin (Now on github!) - im - 02.01.2015

1. Does this plugin work with drop in mysql replacements like mariadb?
2. If I were to host the mysql database in the US and the sa:mp server in the EU, would this cause lag on the server?
Thanks.


Re: [REL] MySQL Plugin (Now on github!) - maddinat0r - 02.01.2015

Quote:
Originally Posted by im
Посмотреть сообщение
1. Does this plugin work with drop in mysql replacements like mariadb?
2. If I were to host the mysql database in the US and the sa:mp server in the EU, would this cause lag on the server?
Thanks.
1. Yes.
2. Yes, it would cause lag if you are using unthreaded queries. Threaded queries do not affect the SA:MP server.


Re: [REL] MySQL Plugin (Now on github!) - Anuris - 03.01.2015

Hi.
How can I get R6 plugin version, since downloading link is not working?


AW: Re: [REL] MySQL Plugin (Now on github!) - Mellnik - 03.01.2015

Quote:
Originally Posted by maddinat0r
Посмотреть сообщение
2. Yes, it would cause lag if you are using unthreaded queries. Threaded queries do not affect the SA:MP server.
If the ping from the EU server to the US server is about 100, it would delay all queries by 100 milliseconds, right?


Re: [REL] MySQL Plugin (Now on github!) - Neufox - 03.01.2015

Can we edit/delete columns even after creating the table. (SQLITE don't support this right?)


Re: [REL] MySQL Plugin (Now on github!) - iZN - 03.01.2015

Quote:
Originally Posted by Neufox
Посмотреть сообщение
Can we edit/delete columns even after creating the table. (SQLITE don't support this right?)
You can edit or delete columns on both MySQL and SQLite.