[Plugin] [REL] MySQL Plugin (Now on github!)

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).
Reply

Can you compile for debian 8 ?
Reply

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

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

Reply

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.
Reply

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

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

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
Reply

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.
Reply

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

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.
Reply

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 "
Reply

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); 
Reply

Thanks buddy, have a cookie.
Reply

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
Reply

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?
Reply

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
Reply

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

mysql_escape_string why? how to fix?
Reply

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

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


Forum Jump:


Users browsing this thread: 26 Guest(s)