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

Quote:
Originally Posted by maddinat0r
Посмотреть сообщение
No, because the default GCC compiler is on version 4.1.x. R39-2 requires at least GCC 4.4.x (and R40 will require GCC 4.7/4..
What does the roadmap look like for R40?
Reply

hello,

im trying to update my server from R34 to R7 and im almost done but i have this problems over here

PHP код:
C:\Users\ZOFTer\Desktop\Ravens MYSQL\gamemodes\ZZZ.pwn(26472) : error 017undefined symbol "inline"
C:\Users\ZOFTer\Desktop\Ravens MYSQL\gamemodes\ZZZ.pwn(26472) : error 017undefined symbol "Grabber"
C:\Users\ZOFTer\Desktop\Ravens MYSQL\gamemodes\ZZZ.pwn(26473) : error 017undefined symbol "cache_insert_id"
C:\Users\ZOFTer\Desktop\Ravens MYSQL\gamemodes\ZZZ.pwn(26477) : error 017undefined symbol "mysql_tquery_inline"
C:\Users\ZOFTer\Desktop\Ravens MYSQL\gamemodes\ZZZ.pwn(26477) : error 017undefined symbol "inline"
C:\Users\ZOFTer\Desktop\Ravens MYSQL\gamemodes\ZZZ.pwn(26477) : warning 215expression has no effect
C
:\Users\ZOFTer\Desktop\Ravens MYSQL\gamemodes\ZZZ.pwn(26477) : warning 215expression has no effect
C
:\Users\ZOFTer\Desktop\Ravens MYSQL\gamemodes\ZZZ.pwn(26477) : error 001expected token";"but found ")"
C:\Users\ZOFTer\Desktop\Ravens MYSQL\gamemodes\ZZZ.pwn(26477) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
7 Errors

PHP код:
                inline Grabber() { // 26472
                    
HouseInfo[houseid][hdbID] = cache_insert_id(dbhandle); // 26473
                    
printf("[SCRIPT]: Created house %d (%d)"houseidHouseInfo[houseid][hdbID]);
                    
OnPropUpdate(1,houseid);
                }
                
mysql_tquery_inline(dbhandle"INSERT INTO properties() VALUES()"using inline "Grabber"""); // 26477 
i hope some one could help me about it
Reply

Quote:
Originally Posted by MCZOFT
Посмотреть сообщение
update my server from R34 to R7
That's a downgrade. The latest release is R39-2.
Reply

Oh my god this is awesome thanks Blue
Reply

Can you add a static version for CentOS 6 for R39-2?
Reply

Trying to update from R37 to R39-2 and I am having a problem
Quote:

[03:49:12] [ERROR] CMySQLConnection::Connect - (error #2002) Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
[03:49:12] [ERROR] CMySQLConnection::Connect - (error #2002) Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
[03:49:12] [ERROR] CMySQLConnection::Connect - (error #2002) Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
[03:49:12] [ERROR] CMySQLConnection::Connect - (error #2002) Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Now here is the problem on R37 it works fine and I don't need for it too connect to mysqld.sock where on R39-2 I have too and the problem is I am on CentOS with cPanel and mysqld.stock isn't included only mysql.stock and there's no way to install the mySQL server with yum or anything I've tried everything.
Reply

Anyone wouldn't have a compiled version of R7 would they? (Don't ask why, I just prefer using that version)
Reply

Quote:
Originally Posted by Campbell-
Посмотреть сообщение
Can you add a static version for CentOS 6 for R39-2?
Use the static version from the general Linux download.

Quote:
Originally Posted by Jake187
Посмотреть сообщение
Trying to update from R37 to R39-2 and I am having a problem


Now here is the problem on R37 it works fine and I don't need for it too connect to mysqld.sock where on R39-2 I have too and the problem is I am on CentOS with cPanel and mysqld.stock isn't included only mysql.stock and there's no way to install the mySQL server with yum or anything I've tried everything.
Create a shared link from 'mysqld.sock' to 'mysql.sock' or use the normal CentOS build (pretty sure that this should fix that error too).
Reply

Quote:
Originally Posted by maddinat0r
Посмотреть сообщение
Use the static version from the general Linux download.


Create a shared link from 'mysqld.sock' to 'mysql.sock' or use the normal CentOS build (pretty sure that this should fix that error too).
Yeah cPanel was blocking all mySQL yum tries, I didn't want to really mess up the mysql so I just used a spare dedicated and built a CentOS with the same mySQL version and everything just not cPanel and stole the 32bit files required and used the CentOS one working fine now, just took a hell of a time.
Reply

Became interested in the question whether to always clear the cache after calling function cache_delete? So I call a function in it made the request in which the value of any returned and I returned it the result of the function. Do I need to return the result before the function to delete the cache?

for example:
GetPlayerEmail(playerid)
{
new query[128];
format(query, 128, "SELECT `email` FROM "MAIN_DB".`users` WHERE `id` = '%d'", PlayerInfo[playerid][User_ID]);
new Cache:result = mysql_query(g_SQL, query);
cache_get_row(0, 0, query);
cache_delete(result); // you need?
return query;
}
Reply

Quote:
Originally Posted by maddinat0r
Посмотреть сообщение
You don't have to resend the queries if the connection dropped. Just enable the auto-reconnect function through mysql_connect (which is enabled by default).
Complete connection is not lost, only the query sent to the host does not get because "lost connection"
Reply

How do I fix this error in my VPS ?

Quote:

Failed (libmysqlclient_r.so.16: cannot open shared object file: No such file or directory)

Reply

Where can I get the mysql.dll ? pls Someone help with compile it ._.
Reply

I always got this bug:
When i leave max_len empty

cache_get_field_content(row, const field_name[], destination[], connectionHandle = 1, max_len = sizeof(destination));

the variable will not saving
Reply

I keep getting a 403 error when I attempt to download the older versions. Can anyone please link me to those versions asap?
Reply

Fix the links
Reply

I have problem with loading string(text) from my db

When i'm load string from table.I got blank string all times.

this is my test command to load string

Код:
cmd:vhouse(pid,params[])
{
	#pragma unused params
	new d[32],a[32],p[32],r[32];
	new rows;
	mysql_query(handle,"SELECT * FROM `adminlog`");
	rows = cache_num_rows();
	for(new i=0;i<rows;i++)
	{
	    cache_get_field_content(0,"Date",d[i]);
        cache_get_field_content(0,"Admin",a[i]);
        cache_get_field_content(0,"Player",p[i]);
        cache_get_field_content(0,"Reason",r[i]);
        sfm(pid,-1,"Date: %s,Admin: %s,Player: %s,Reason: %s",d[i],a[i],p[i],r[i]);
	}
	return 1;
	

}
This data in adminlog Table



And this is mysql_log.txt

Код:
[12:34:03] [DEBUG] cache_get_row_count - connection: 1
[12:34:03] [DEBUG] cache_get_field_content - row: 0, field_name: "Date", connection: 1, max_len: 1
[12:34:03] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Date", data: "11/พฤศจิกายน/2014 - 15:15"
[12:34:03] [DEBUG] cache_get_field_content - row: 0, field_name: "Admin", connection: 1, max_len: 1
[12:34:03] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Admin", data: "izcream"
[12:34:03] [DEBUG] cache_get_field_content - row: 0, field_name: "Player", connection: 1, max_len: 1
[12:34:03] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Player", data: "ไม่มี"
[12:34:03] [DEBUG] cache_get_field_content - row: 0, field_name: "Reason", connection: 1, max_len: 1
[12:34:03] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Reason", data: "สร้าง Pickup"
[12:34:03] [DEBUG] cache_get_field_content - row: 0, field_name: "Date", connection: 1, max_len: 1
[12:34:03] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Date", data: "11/พฤศจิกายน/2014 - 15:15"
[12:34:03] [DEBUG] cache_get_field_content - row: 0, field_name: "Admin", connection: 1, max_len: 1
[12:34:03] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Admin", data: "izcream"
[12:34:03] [DEBUG] cache_get_field_content - row: 0, field_name: "Player", connection: 1, max_len: 1
[12:34:03] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Player", data: "ไม่มี"
[12:34:03] [DEBUG] cache_get_field_content - row: 0, field_name: "Reason", connection: 1, max_len: 1
[12:34:03] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Reason", data: "สร้าง Pickup"
[12:34:03] [DEBUG] cache_get_field_content - row: 0, field_name: "Date", connection: 1, max_len: 1
[12:34:03] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Date", data: "11/พฤศจิกายน/2014 - 15:15"
[12:34:03] [DEBUG] cache_get_field_content - row: 0, field_name: "Admin", connection: 1, max_len: 1
[12:34:03] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Admin", data: "izcream"
[12:34:03] [DEBUG] cache_get_field_content - row: 0, field_name: "Player", connection: 1, max_len: 1
[12:34:03] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Player", data: "ไม่มี"
When i use /vhouse cmd i got blank string




how to fix it


ps.sorry for my bad english
Reply

@basicllsw: You are doing it completely wrong.

pawn Код:
cmd:vhouse(pid,params[])
{
    #pragma unused params
    mysql_tquery(handle, "SELECT * FROM adminlog", "OnLoadAdminLog", "i", playerid);
    return true;
}

forward OnLoadAdminLog(playerid);
public OnLoadAdminLog(playerid)
{
    new d[32], a[32], p[32], r[32];
   
    for(new i = 0; i != cache_get_row_count(); i++)
    {
        cache_get_field_content(i, "Date", d);
        cache_get_field_content(i, "Admin", a);
        cache_get_field_content(i, "Player", p);
        cache_get_field_content(i, "Reason", r);
        printf("Date: %s, Admin: %s, Player: %s, Reason: %s", d, a, p, r);
        //sfm(playerid,-1,"Date: %s, Admin: %s, Player: %s, Reason: %s", d, a, p, r);
    }
    return true;
}
Reply

@iZN it's work thanks

but i not want to add OnLoadAdminLog can it's finish in one place

i think if i created many public about sql it's use more resource on my server

ps.sorry for my bad english

edit: i succes to finish this Thanks @iZN alot
Reply

Hello!

MySQL R39-2, when doing an INSERT INTO, we do not specify the id.

Is it possible to force to use a specific id?

Ex: Force to insert a line with a given id.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)