[Plugin] [REL] SA:MP MySQL Plugin 2.1.1 - Released (1/25/2011

How can I add it to my website so the players can log in with their IG names instead creating a new account on the website and logging in with it? Is this possible?
Reply

marko i think you could connect to the database on your website and insert a new user there when they register, then they should be able to use the username and account on the server and your website.
i think you can anyway
Reply

Great work with the plugin, but there is a mistake in the wiki article at mysql_connect:

Quote:

mysql_connect
Use this function to connect to the mysql database.


Parameters:
(const host[], const user[], const pass[], const db[], auto_reconnect, MySQL:handle)const host[] The address of the mysql database.

should be:
Quote:

Parameters:
(const host[], const user[], const pass[], const db[], MySQL:handle, auto_reconnect)const host[] The address of the mysql database.

would be nice if somebody with an wiki account updates the aricle.
https://sampwiki.blast.hk/wiki/MySQL_Plugin
generally the wiki article isn't up to date and there are many examples missing
Reply

Quote:
Originally Posted by StrickenKid
Посмотреть сообщение
  1. First of all, you must locate where your mysql libraries are located.
    Mine are located at: /usr/local/mysql/lib/mysql
  2. Now, open libc.conf located in /etc/ld.so.conf.d
  3. Add the mysql libraries' path to the end of this file, on a new line.
  4. Save the file, and execute: ldconfig
I did that.
My MySQL is in /usr/include/mysql and /usr/lib/mysql.
I added both to the libc.conf.

But i get the same Error
What can i do?

(When i use the Statics, i get a Error with /tmp/mysql.sock)
Reply

mysql_fetch_float returns on Linux always ";((/))" or so.. and not that, what that wanted to return
Reply

for those using this plugin looking for a replacement method, me and my infinite wisdom have divised an alternative.

pawn Код:
MySQLFetchAcctRecord(PlayerInfo[playerid][pSQLID], Data);
        for (new rcnt = 0; rcnt < mysql_num_fields(); rcnt++)
        {
            mysql_fetch_field_num(rcnt, Field, MainDB);
            // The rcnt values here represent the order of the columns in the characters table, so don't mess with them
            // If you add a column to the table, just add a new line with a +1 rcnt to the block below
            // Start it at 3 to skip the first few records we don't need (id, player name, password)
            if (rcnt == 3) PlayerInfo[playerid][pLevel] = strvalEx(Field);
this replaces the code from the old MySQL plugin..

pawn Код:
MySQLFetchAcctRecord(PlayerInfo[playerid][pSQLID], Data);
        samp_mysql_strtok(Field, "|", Data);
        while (samp_mysql_strtok(Field, "|", "")==1)
        {
            // The rcnt values here represent the order of the columns in the characters table, so don't mess with them
            // If you add a column to the table, just add a new line with a +1 rcnt to the block below
            // Start it at 3 to skip the first few records we don't need (id, player name, password)
            if (rcnt == 3) PlayerInfo[playerid][pLevel] = strvalEx(Field);
EDIT: I'm fairly sure there is something wrong with this code somewhere, still figuring it out.
EDIT2: make sure you remove rcnt++; from the bottom of the section (or it will skip every second field)
Reply

Код:
[MySQL] Error (0): Function: mysql_connect failed, mysql was not initialized on this handle.
Why i have this error?
I have a linux host, and i use the static build...
Reply

it's true that if i install libmysqlclient.so.15 on CentOS(linux) it will use more RAM memori and server will lag ?
i realy need this information pls answer
Reply

Quote:
Originally Posted by dudekz
Посмотреть сообщение
How to run plugin with other socket directory?
I have here socket on server: /var/run/mysqld/mysqld.sock
create a symbolic link in /tmp/

cd /tmp
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

worked for me
Reply

Код:
Error (0): Failed to connect. Access denied for user 'root'@'localhost' (using password: YES).
I use the same login info before with the G-Stylez plugin. It won't let me connect now!
Reply

Change your mysql_connect to this one:

mysql_connect(host, username, password, database, 1);

( With G-sTyLeZzZ's looks like: mysql_connect(host, username, database, password); )

I think you mixed up the password and database name.
Reply

Whats the equivalent of mysql_retrieve_row() on this?
Reply

Quote:
Originally Posted by lolumadd_
Посмотреть сообщение
Whats the equivalent of mysql_retrieve_row() on this?
try native mysql_fetch_row_data(MySQL:handle = MySQL:0);
Reply

Function mysql_query is bug.

Should be:

Код:
1 - is success
0 - is failed
Reply

I downloaded cwrp, i uploaded to another mysql plugin (stickenkid)
Код:
mysql_strtok(Field, "|", Data);
		while (mysql_strtok(Field, "|", "")==1)
I heard that is changed with the mysql_fetch_row, but i have in the script tones of mysql_fetch_row(line[])
How do i change mysql_strtok and mysql_fetch_row?
Reply

For your information:

If you have one connection to your database, then you have to be sure that none of the functions are storing any results of a query are inside a loop of a result of a query.

Query -> StoreResult -> Loop: Query/StoreResult (Loop fails because the earlier result doesnt exist anymore)

You can avoid this with a second connection.

Query (connection 0) -> StoreResult (connection 0) -> Loop:
{
Query (connection 1) -> StoreResult (connection 1) ... etc
FreeResult (connection 1)
}
FreeResult ( connection 0 )

There is a fail error message when you try to get the row (mysql_fetch_row):
Blah blah.. mysql_store_result couldn blah blah
- mysql_fetch_row is meant
Reply

Could anyone tell me how to fetch multiple rows using this plugin?
Reply

Quote:
Originally Posted by Luнs Miki
Посмотреть сообщение
Could anyone tell me how to fetch multiple rows using this plugin?
Код:
mysql_store_result( mysql_connection_id );

for( new index = 0; index < mysql_num_rows( mysql_connection_id ); index++ )
{
    new row[ 256 ];
    mysql_fetch_row_format( row, "|", mysql_connection_id );

    // Whatever you want to do with this row.
}

mysql_free_result( mysql_connection_id );
A vague example I just wrote up, you'll have to modify some parts to fit it into your own code.
Reply

Isn't it Gstylez' plugin funcions?

mysql_fetch_row_format( row, "|", mysql_connection_id );
Reply

Oh, thanks you helped me -alot-. (: Now I get it.

THANK YOU =)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)