SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 07/07/2015, 02:13 PM   #5641
maddinat0r
Banned
 
Join Date: Jun 2010
Location: Germany
Posts: 848
Reputation: 482
Default Re: [REL] MySQL Plugin (Now on github!)

Try re-downloading R39-3 (and don't forget to replace the libmysql.dll).
Do you have the parameter pool_size in mysql_connect set to zero?
maddinat0r is offline   Reply With Quote
Old 07/07/2015, 05:42 PM   #5642
b3nz
Little Clucker
 
Join Date: Jun 2015
Posts: 47
Reputation: 17
Default Re: [REL] MySQL Plugin (Now on github!)

The problem is that I can't use newer version than R34, as right now I'm using Windows XP, which doesn't support KERNEL32 library.

EDIT: pool_size was added in R35, so I can't even use it. :\
b3nz is offline   Reply With Quote
Old 08/07/2015, 08:48 AM   #5643
DetoNater
Huge Clucker
 
DetoNater's Avatar
 
Join Date: Feb 2013
Location: !ncredible India
Posts: 253
Reputation: 6
Default Re: [REL] MySQL Plugin (Now on github!)

Actually, the old function of fetching both field(column) and row is done by mysql_fetch_field_row ? which retrives both fiekd and row, but in new plugin which equivalent cmd would do so?

My code
Code:
if(cache_num_rows(mysql) > 0)
   	{
	    //while(mysql_fetch_field_row(string,"|"))
            cache_get_row(10,"|",string);// argument type mismatch, i know the param entered is wrong!
	    {
	        sscanf(string,"p<|>s[7]i",Clan,score);
	        format(content,sizeof(content),"%s%s\t\t%d Score\n",content,Clan,score);
            }
	}
__________________

Helpers Needed for the Community!


We're on Hosted Tab
DetoNater is offline   Reply With Quote
Old 08/07/2015, 10:29 AM   #5644
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 10,093
Reputation: 2655
Default Re: [REL] MySQL Plugin (Now on github!)

It doesn't work like that at all. Every field is already fetched separately and you don't have to split it yourself. You can get the value either by the position in the result or by column name, which is slightly slower.
__________________
Vince is offline   Reply With Quote
Old 08/07/2015, 11:01 AM   #5645
kristo
Banned
 
Join Date: Jun 2012
Location: Estonia
Posts: 370
Reputation: 179
Default Re: [REL] MySQL Plugin (Now on github!)

I was thinking of a new feature while reading this thread: http://forum.sa-mp.com/showthread.ph...09#post3513809

pawn Code:
enum
{
    FIELD_TYPE_INT, // int, tinyint, etc.
    FIELD_TYPE_ARRAY, // varchar, text, etc.
    FIELD_TYPE_FLOAT, // float, double
}
#define FIELD_TYPE_STRING FIELD_TYPE_ARRAY

native cache_get_field_type(field_index, connectionHandle = 1);
native cache_get_field_name_type(const field_name[], connectionHandle = 1); // should be renamed, I couldn't think of a better name
kristo is offline   Reply With Quote
Old 08/07/2015, 12:38 PM   #5646
KingServerIRAN
Banned
 
Join Date: Aug 2013
Location: SarBNR, IRAN!. Reputation:9999. . Posts2: 160754
Posts: 361
Reputation: 45
Default Re: [REL] MySQL Plugin (Now on github!)

Good Job
KingServerIRAN is offline   Reply With Quote
Old 08/07/2015, 06:27 PM   #5647
maddinat0r
Banned
 
Join Date: Jun 2010
Location: Germany
Posts: 848
Reputation: 482
Default Re: [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by b3nz View Post
The problem is that I can't use newer version than R34, as right now I'm using Windows XP, which doesn't support KERNEL32 library.

EDIT: pool_size was added in R35, so I can't even use it. :\
Okay, try re-downloading and re-installing R34 (re-installing = replacing all files with the new download; don't forget the libmysql.dll!).

Quote:
Originally Posted by kvann View Post
I was thinking of a new feature while reading this thread: http://forum.sa-mp.com/showthread.ph...09#post3513809

pawn Code:
enum
{
    FIELD_TYPE_INT, // int, tinyint, etc.
    FIELD_TYPE_ARRAY, // varchar, text, etc.
    FIELD_TYPE_FLOAT, // float, double
}
#define FIELD_TYPE_STRING FIELD_TYPE_ARRAY

native cache_get_field_type(field_index, connectionHandle = 1);
native cache_get_field_name_type(const field_name[], connectionHandle = 1); // should be renamed, I couldn't think of a better name
May I ask what kind of purpose those functions would serve?
maddinat0r is offline   Reply With Quote
Old 08/07/2015, 07:28 PM   #5648
kristo
Banned
 
Join Date: Jun 2012
Location: Estonia
Posts: 370
Reputation: 179
Default Re: [REL] MySQL Plugin (Now on github!)

Nah, it ain't necassary anymore. Forget about it.
kristo is offline   Reply With Quote
Old 09/07/2015, 07:19 PM   #5649
Misiur
High-roller
 
Misiur's Avatar
 
Join Date: Jul 2009
Location: Poland
Posts: 2,528
Reputation: 554
Default Re: [REL] MySQL Plugin (Now on github!)

Hm, no idea why I haven't asked about this before: Is there a way for bulk orm operations? Say, send them as a transaction? Would normal tquery with transaction start beforehand suffice?
Misiur is offline   Reply With Quote
Old 09/07/2015, 08:48 PM   #5650
maddinat0r
Banned
 
Join Date: Jun 2010
Location: Germany
Posts: 848
Reputation: 482
Default Re: [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by Misiur View Post
Hm, no idea why I haven't asked about this before: Is there a way for bulk orm operations? Say, send them as a transaction? Would normal tquery with transaction start beforehand suffice?
All ORM queries use the same direct database connection mysql_tquery uses, thus it should suffice to start/end an transaction through mysql_tquery before/after calling orm_select/orm_update/orm_insert/orm_delete.
maddinat0r is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
****** Project: Glass int3s0 Everything and Nothing 99 26/02/2013 04:22 PM
MySQL Plugin R5 plugin problem dud Scripting Help 12 05/12/2011 06:28 PM
Strikens Mysql vs BlueG's Mysql plugin PrawkC Scripting Help 4 30/09/2011 10:30 AM
[help][plugin] Can't load mysql plugin mariomako Help Archive 8 16/07/2011 02:37 PM
mysql plugin. loading plugin failed ikkentim Help Archive 2 10/02/2011 02:32 PM


All times are GMT. The time now is 02:04 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.