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!) - Konstantinos - 04.12.2016

Quote:
Originally Posted by vannesenn
Посмотреть сообщение
all builds from now on prefer the MariaDB C connector"

I don't understand what you want to say.
libmysql.dll is basically replaced with libmariadb.dll (which is a lot smaller in size from what I see).


Re: [REL] MySQL Plugin (Now on github!) - MerryDeer - 04.12.2016

Can you compile for debian 8 ?


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

Quote:
Originally Posted by MerryDeer
Посмотреть сообщение
Can you compile for debian 8 ?
Will do that tomorrow.


Re: [REL] MySQL Plugin (Now on github!) - RIDE2DAY - 06.12.2016

Good job maddinat0r, I love mysql_connect_file and cache_insert_id. By the way, how can multiple SQL statements be sent with this plugin? Adding a semicolon after each statement?

Should cache_get_result_count and cache_get_row_count be used first as a condition always? Why would they fail? I mean, is there any difference between the following two examples?
PHP код:
/* Query */
mysql_pquery(sql_handle"SELECT `id`, `password` FROM `player_info` WHERE `name`='RIDE2DAY' LIMIT 1""CheckAccount");
/* CheckAccount Callback */
/* Method #1 */
new results;
if(
cache_get_result_count(results))
{
    
cache_set_result(0);
    new 
rows;
    if(
cache_get_row_count(rows))
    {
        if(
rows)
        {
            
// Log In
        
}
        else
        {
            
            
// Register
        
}
    }
}
/* Method #2 */
cache_set_result(0);
new 
rows;
cache_get_row_count(rows);
if(
rows)
{
    
// Log In
}
else
{
    
    
// Register




Re: [REL] MySQL Plugin (Now on github!) - Max_Andolini - 06.12.2016

Quote:
Originally Posted by RIDE2DAY
Посмотреть сообщение
Good job maddinat0r, I love mysql_connect_file and cache_insert_id. By the way, how can multiple SQL statements be sent with this plugin? Adding a semicolon after each statement?

Should cache_get_result_count and cache_get_row_count be used first as a condition always? Why would they fail? I mean, is there any difference between the following two examples?
PHP код:
/* Query */
mysql_pquery(sql_handle"SELECT `id`, `password` FROM `player_info` WHERE `name`='RIDE2DAY' LIMIT 1""CheckAccount");
/* CheckAccount Callback */
/* Method #1 */
new results;
if(
cache_get_result_count(results))
{
    
cache_set_result(0);
    new 
rows;
    if(
cache_get_row_count(rows))
    {
        if(
rows)
        {
            
// Log In
        
}
        else
        {
            
            
// Register
        
}
    }
}
/* Method #2 */
cache_set_result(0);
new 
rows;
cache_get_row_count(rows);
if(
rows)
{
    
// Log In
}
else
{
    
    
// Register

Код:
/* Query */ 
mysql_pquery(sql_handle, "SELECT `id`, `password` FROM `player_info` WHERE `name`='RIDE2DAY' LIMIT 1", "CheckAccount"); 

/* CheckAccount Callback */ 
/* Method #1 */ 
new results; 
cache_get_result_count(results);
if(results) 
{ 
    new rows; 
    cache_get_row_count(rows);
    if(rows) 
    { 
        // Log In 
    } 
    else 
    { 
        // Register 
    } 
}
Use this.


Re: [REL] MySQL Plugin (Now on github!) - Doritoss - 09.12.2016

The mysql_log function doesn't work with R41-2.

Код:
error 017: undefined symbol "LOG_ERROR"



Re: [REL] MySQL Plugin (Now on github!) - Konstantinos - 09.12.2016

Quote:
Originally Posted by Doritoss
Посмотреть сообщение
The mysql_log function doesn't work with R41-2.

Код:
error 017: undefined symbol "LOG_ERROR"
https://sampwiki.blast.hk/wiki/MySQL/R40#Log_levels
https://sampforum.blast.hk/showthread.php?tid=616103


Re: [REL] MySQL Plugin (Now on github!) - ranme15 - 05.02.2017

Quote:
Originally Posted by Cyber123
View Post
Why you didnt make any example script for newer versions, like simple register/login system?
There is actually in the zip package.


Re: [REL] MySQL Plugin (Now on github!) - iLearner - 10.02.2017

How can we use the LIKE '%...%' clause? since the plugin converts ' into ", while mysql requires ' ' around the %...%


Re: [REL] MySQL Plugin (Now on github!) - TommyB - 10.02.2017

Quote:
Originally Posted by iLearner
View Post
How can we use the LIKE '%...%' clause? since the plugin converts ' into ", while mysql requires ' ' around the %...%
Use two percent signs. More info here.


Re: [REL] MySQL Plugin (Now on github!) - iLearner - 10.02.2017

Quote:
Originally Posted by TommyB
View Post
Use two percent signs. More info here.
%% arent a problem, the problem is typing ' '

Format: LIKE '%SEARCHEDTERM%'

we cant type ' via pawn, as the plugin will convert it into "


Re: [REL] MySQL Plugin (Now on github!) - TommyB - 10.02.2017

Quote:
Originally Posted by iLearner
View Post
%% arent a problem, the problem is typing ' '

Format: LIKE '%SEARCHEDTERM%'

we cant type ' via pawn, as the plugin will convert it into "
Really? I don't have that problem. Here's a query that works just fine for me.

PHP Code:
mysql_format(connmquerysizeof(mquery), "SELECT OwnerName,PhoneNumber FROM phones WHERE OwnerName LIKE '%%%e%%' AND ShowPhonebook = 1 LIMIT 25"params); 



Re: [REL] MySQL Plugin (Now on github!) - iLearner - 11.02.2017

Thanks buddy, have a cookie.


Re: [REL] MySQL Plugin (Now on github!) - Kar - 19.02.2017

I have a new laptop, it's pretty new.. (kaby lake).

I installed the required packages. MySQL still fails to load on windows. R41-2.

I installed the C connector, and OpenSSL 1.0.2k 32 and 64 bit side to side (since the latest C connector uses 1.0.2 by default now ).

Still not loading


Re: [REL] MySQL Plugin (Now on github!) - Jeroen52 - 19.02.2017

Quote:
Originally Posted by Kar
View Post
I have a new laptop, it's pretty new.. (kaby lake).

I installed the required packages. MySQL still fails to load on windows. R41-2.

I installed the C connector, and OpenSSL 1.0.2k 32 and 64 bit side to side (since the latest C connector uses 1.0.2 by default now ).

Still not loading
Could you give more information if you are building the plugin from source? And which operating system (and if Linux, which distro and architecture) you are using?


- Kar - 19.02.2017

Windows 10 x64, I haven't tried building yet. My Visual Studio is still getting ready. I'm going to try when it's done.

log-core.so and mysql.so (32 bit) (dynamically linked) compiled on Ubuntu Trusty 14.04.

https://www.mediafire.com/?6pizjdu8n...movhmp7x17i60l


Re: [REL] MySQL Plugin (Now on github!) - vasyok28 - 21.02.2017

Hello! After omission of MySQL is disconnected from the server, and restores the connection is not re-encoding.
What solution ?


Re: [REL] MySQL Plugin (Now on github!) - Wahyu33 - 22.02.2017

mysql_escape_string why? how to fix?


Re: [REL] MySQL Plugin (Now on github!) - vannesenn - 26.02.2017

Quote:
Originally Posted by Wahyu33
Посмотреть сообщение
mysql_escape_string why? how to fix?
mysql_format and operator %e


Re: [REL] MySQL Plugin (Now on github!) - Kar - 07.03.2017

I feel like the next version should be tested with 5.6 and 5.7