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

I'm testing it on a local server, on Windows.
Reply

Here is some buggs. One time i on my gamemode all was loading (mysql) houses, bussines server crashed due unknow error (by crash detector), but there writes mysql, i reload server then everything okey, it'is maybe 1 way from 1000 that happin small but still there haven't be that.
Reply

Please fix the link
Reply

Why does cache_get_field_contente_int fail on converted types?

Table:
Code:
CREATE TABLE IF NOT EXISTS graffiti_colours 
	(
		id INT AUTO_INCREMENT NOT NULL,
		name VARCHAR(32) NOT NULL,
		argb VARCHAR(8) NOT NULL,
		PRIMARY KEY(id)
	) ENGINE=INNODB DEFAULT CHARSET cp1257 COLLATE=cp1257_bin;
Query:
Code:
SELECT id, CONVERT(CONV(argb, 16, 10), SIGNED) AS argb FROM graffiti_colours WHERE name = '%e'
Code:
pawn Code:
cache_get_field_content_int(0, "argb");
Log:
Code:
20:47:45	cache_get_field_content_int	OK	row: 0, field_name: "argb", connection: 1
20:47:45	CMySQLResult::GetRowDataByName	OK	row: '0', field: "argb", data: "4294901760"
20:47:45	cache_get_field_content_int	ERROR	invalid datatype
Reply

I believe it returns a 64 bit integer, which Pawn cannot handle. Not sure why you're not simply storing the color as an int rather than a varchar in the first place.
Reply

Just for the ability to see it as a HEX in the database. I know that that should not be a factor when designing a database but...
Reply

link not work!
Reply

there's a problem loading the plugin. I have the latest versions of includes and I have 2012 Redistributable
Reply

Quote:
Originally Posted by DarkPower2
View Post
link not work!
Its on github... they work.

Quote:
Originally Posted by DetoNater
View Post
there's a problem loading the plugin. I have the latest versions of includes and I have 2012 Redistributable
What kind of problem? Any error messages or the loading just fails?
Reply

New link for MYSQL R7 ?
EDIT : If you don't find the link, I give this website for you : http://kaperstone.ru/samp/mysql/
Reply

This version is clearly outdated.

If there were updates, that's not only for the fun to work on a plugin : it adds new features and improvements.
If those version are not advocated, it's mainly because you see better, easier to learn/use and faster.

Those who stick with R7 are just too lazy to update their modes.
Reply

delete found my answer
Reply

Hello BlueG.

Some kind of issue here...
SA-MP server 0.3z R4 with MySQL R39-3, running on Debian x64.
PHP Code:
//In some public
            
new qwery[300];
            
format(qwerysizeof(qwery), "SELECT `lvl` FROM `admins` WHERE BINARY `Nick` = '%s'"GN(playerid));
            
mysql_function_query(MySQLqwerytrue"OnAdminQueryFinished""i"playerid);
                
SendClientMessage(playerid, -1qwery); 
PHP Code:
public OnAdminQueryFinished(playerid)
{
    new 
lvl cache_get_row_int(0,0);
    
SendMes(playerid, -1"%i"lvl);
    if(
lvl 0)
    {
        
//Don't exec
    
}
    else 
    {
        
//exec
    
}
    return 
0;

As you see, I've added 2 debugging messages.
They sends:

Code:
[15:09:17] SELECT `lvl` FROM `admins` WHERE BINARY `Nick` = 'Эраст_Фандорин'

[15:09:17] 0
But, if I exec the same Query (just copy it from chat log) in phpmyadmin, it will return 10, not 0.



Here is a point: I'm adding some symbols from Russian alphabet in my Query (`Nick` = 'Эраст_Фандорин'), but it works just fine with phpmyadmin.

UPD: works fine without Russian symbols...can you fix it, please?
Reply

@Anuris:

pawn Code:
public OnAdminQueryFinished(playerid)
{
    // first we've to check whether there are any results, if yes, it will simply continue.. otherwise, nothing will happen, you could add an else statement to the following if statement if you wanted to do something about when there are no row existing rows.
    if(cache_get_row_count())
    {
        new lvl = cache_get_row_int(0,0);
        SendMes(playerid, -1, "%i", lvl);
        if(lvl > 0)
        {
            //Don't exec
        }
        else
        {
            //exec
        }
    }
    return true; // returning true will clear out this callback's cache.
}
Reply

Quote:
Originally Posted by Ralfie
View Post
Hi, how can if find if a specific word in a string im providing matches a row i have?
i.e:

string = "Hello World"

Table:
Code:
...

Something more like the strfind function: if (~strfind("World", "Hello Wrold", true))
LIKE(). I guess there is another one that I don't seem to remember.

PHP Code:
SELECT FROM tbl_name WHERE tbl_field LIKE "% foo %"
Reply

I'm sorry, but...bump!
Quote:
Originally Posted by Anuris
View Post
Hello BlueG.

Some kind of issue here...
SA-MP server 0.3z R4 with MySQL R39-3, running on Debian x64.
PHP Code:
//In some public
            
new qwery[300];
            
format(qwerysizeof(qwery), "SELECT `lvl` FROM `admins` WHERE BINARY `Nick` = '%s'"GN(playerid));
            
mysql_function_query(MySQLqwerytrue"OnAdminQueryFinished""i"playerid);
                
SendClientMessage(playerid, -1qwery); 
PHP Code:
public OnAdminQueryFinished(playerid)
{
    new 
lvl cache_get_row_int(0,0);
    
SendMes(playerid, -1"%i"lvl);
    if(
lvl 0)
    {
        
//Don't exec
    
}
    else 
    {
        
//exec
    
}
    return 
0;

As you see, I've added 2 debugging messages.
They sends:

Code:
[15:09:17] SELECT `lvl` FROM `admins` WHERE BINARY `Nick` = 'Эраст_Фандорин'

[15:09:17] 0
But, if I exec the same Query (just copy it from chat log) in phpmyadmin, it will return 10, not 0.



Here is a point: I'm adding some symbols from Russian alphabet in my Query (`Nick` = 'Эраст_Фандорин'), but it works just fine with phpmyadmin.

UPD: works fine without Russian symbols...can you fix it, please?
Reply

Quote:
Originally Posted by iZN
View Post
Is there any issues with newer releases?

https://github.com/pBlueG/SA-MP-MySQL/releases
No, I just don't know how to use threading.

If anyone does know how to use threading, could you please make a topic on how to use it with the newest release or if there already is a topic please can you link me?
Reply

Quote:
Originally Posted by MotherDucker
View Post
No, I just don't know how to use threading.

If anyone does know how to use threading, could you please make a topic on how to use it with the newest release or if there already is a topic please can you link me?
https://sampforum.blast.hk/showthread.php?tid=337810

it's outdated but it should be fine, and then use the wiki for more details about the latest functions.
Reply

Whenever I include mysql, It crashes the compiler... Any fix is appreciated.

Please note that I dont use any functions... I just included it and the compiler crashes and whenever I remove it, The compiler works.

OK, I figured it out by looking at the code.
I just forgot to include MYSQL_USE_YINLINE or E_CALLBACK_DATA
Reply

well i have a bug to report, i use r39-2 and sometimes some weird shit goes like i crash(it is my client or intended by me to do it) and some variables are saved badly and i say badly because i am on x,y,z and it's saved on 1.23E10 0 0.35, or the money variable goes on rampage with positive or negative values.
It is quite annoying.
It is a bug discovered or something new?
well i use orm system if i didn't mention.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)