SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 18/06/2010, 12:14 PM   #1141
Astaroth
Little Clucker
 
Join Date: May 2010
Posts: 32
Reputation: 0
Default Re: [REL] MySQL Plugin R4 (21/04/2010)

Quote:
Originally Posted by ledzep
I don't think mysql_errno is working properly anymore. I used to use it to check if queries were performed properly or not, but now it seems that it no longer returns 0 on successful queries.

EDIT: R2 plugin works. Only later versions have this problem (if it is a problem? sure is for me anyway )
There's a bug in the R4-2 version. I found it and I made a patch, but G-sTyLeZzZ don't answer my PM's and don't update the plugin in this thread. If you want the patched version send me a PM.
Astaroth is offline   Reply With Quote
Old 18/06/2010, 02:28 PM   #1142
Astaroth
Little Clucker
 
Join Date: May 2010
Posts: 32
Reputation: 0
Default Re: [REL] MySQL Plugin R4 (21/04/2010)

G-sTyLeZzZ authorized me to post the patched plugin. I'm at work now so I don't have the code to compile it. But, I have the windows version compiled in my mail. You can download the mysql.dll (VS9) lib here:



I'm not sure if works 100% OK, but the query function and some more works fine. Please try it, and if you found some bug tell me.




P.S: In a few hours I'll upload the linux version
Astaroth is offline   Reply With Quote
Old 18/06/2010, 10:05 PM   #1143
Carlton
Gangsta
 
Carlton's Avatar
 
Join Date: Mar 2010
Posts: 687
Reputation: 0
Default Re: [REL] MySQL Plugin R4 (21/04/2010)

Quote:
Originally Posted by Carlton
Err, why's mysql_retrieve_row() is returning 0?

pawn Code:
format(stringformat, sizeof(stringformat), "SELECT buSQLID FROM Buildings WHERE buName = '%s'",sscanfinput);
mysql_query(stringformat);
        mysql_store_result();
        new sid[5];
        if(mysql_retrieve_row())
        {
              mysql_fetch_field_row(sid, "buSQLID");
        }
        else {
  printf("%d", mysql_errno());
}
sscanfid[1] = strval(sid);
mysql_free_result();

MySQL_errno returns 0 also when I printed it, and this is what the MySQL log says:
Quote:
Originally Posted by MySQL log
[03:20:25] CMySQLHandler::Query(SELECT buSQLID FROM Buildings WHERE buName = 'Los Santos PD(Lower)') - Successfully executed.

[03:20:25] >> mysql_store_result( Connection handle: 1 )

[03:20:25] CMySQLHandler::StoreResult() - Result was stored.

[03:20:25] >> mysql_retrieve_row( Connection handle: 1 )

[03:20:25] >> mysql_errno( Connection handle: 1 )

[03:20:25] >> mysql_free_result( Connection handle: 1 )

[03:20:25] CMySQLHandler::FreeResult() - Result was successfully free'd.
It would be nice if I can get an answer.
Carlton is offline   Reply With Quote
Old 18/06/2010, 10:20 PM   #1144
Sergei
High-roller
 
Sergei's Avatar
 
Join Date: Mar 2008
Location: Slovenia
Posts: 2,871
Reputation: 230
Default Re: [REL] MySQL Plugin R4 (21/04/2010)

There are no rows to be retrieved. Run your query in phpMyAdmin or console and see if it gets oyu any results actually.
__________________
Watch out, scouts everywhere!
Sergei is offline   Reply With Quote
Old 18/06/2010, 10:27 PM   #1145
Carlton
Gangsta
 
Carlton's Avatar
 
Join Date: Mar 2010
Posts: 687
Reputation: 0
Default Re: [REL] MySQL Plugin R4 (21/04/2010)

Quote:
Originally Posted by $€ЯĢ
There are no rows to be retrieved. Run your query in phpMyAdmin or console and see if it gets oyu any results actually.
It does return the ID, it points me out to a row with the ID, and a message at the bottom of the page.

Quote:
Originally Posted by PHPMyAdmin
unkown table status: TABLE_TYPE
Carlton is offline   Reply With Quote
Old 19/06/2010, 05:34 PM   #1146
DarkChildren
Gangsta
 
DarkChildren's Avatar
 
Join Date: Oct 2009
Location: España
Posts: 684
Reputation: 9
Default Re: [REL] MySQL Plugin R4 (21/04/2010)

Good Job!! nice
__________________
Aprende a ser tu mismo
DarkChildren is offline   Reply With Quote
Old 21/06/2010, 12:01 PM   #1147
ba200101
Little Clucker
 
Join Date: Jun 2009
Posts: 27
Reputation: 0
Default Re: [REL] MySQL Plugin R4 (21/04/2010)

Uh I have a question
Whether the Port will replace SQL
3306 I can not use
Can help change the 3307?
I am using version 0.14
Sorry my English not good

Only because my host provider to install MYSQL,
Not help to install WAMP or XMAP related software. Why we have this problem
If you want to get irrigation to replace the type of software plug-in port to 3307

Urge everyone to help!!
ba200101 is offline   Reply With Quote
Old 21/06/2010, 03:27 PM   #1148
Sergei
High-roller
 
Sergei's Avatar
 
Join Date: Mar 2008
Location: Slovenia
Posts: 2,871
Reputation: 230
Default Re: [REL] MySQL Plugin R4 (21/04/2010)

Why can't you use port 3306? If it's already used then another MySQL server is already using it, so I don't know why you would need two MySQL servers on the same IP.
__________________
Watch out, scouts everywhere!
Sergei is offline   Reply With Quote
Old 21/06/2010, 05:29 PM   #1149
Astaroth
Little Clucker
 
Join Date: May 2010
Posts: 32
Reputation: 0
Default Re: [REL] MySQL Plugin R4 (21/04/2010)

Quote:
Originally Posted by ba200101
Uh I have a question
Whether the Port will replace SQL
3306 I can not use
Can help change the 3307?
I am using version 0.14
Sorry my English not good

Only because my host provider to install MYSQL,
Not help to install WAMP or XMAP related software. Why we have this problem
If you want to get irrigation to replace the type of software plug-in port to 3307

Urge everyone to help!!
You want to install a MySQL Instance that "listen" in port 3307?
Astaroth is offline   Reply With Quote
Old 06/07/2010, 05:48 PM   #1150
michael2572
Big Clucker
 
Join Date: Jan 2007
Posts: 49
Reputation: 20
Default Re: [REL] MySQL Plugin R4 (21/04/2010)

I have discovered a pretty nasty problem. It appears that mysql_fetch_row_format is limited as to how many rows it can return. Take this pawn code, for instance:

pawn Code:
new count = mysql_num_rows(SQLHandle);
   
printf("Countrows = %d", count);

new i=0;
new row[128];
while (mysql_retrieve_row(SQLHandle))
{
    mysql_fetch_row_format(row, " ", SQLHandle);
    i++;
}
printf("Should be = %d", i);

If you run a large query, say with 30-40 rows in the resultset, mysql_retrive_row will only allow the loop to iterate about half of the actual row count. (EDIT: It is actually exactly half in all cases) The output for this is likely something like:

Code:
Countrows = 34
Should be = 17
Interestingly enough, commenting out "mysql_fetch_row_format(row, " ", SQLHandle);" produces:

Code:
Countrows = 34
Should be = 34
So this leads me to believe the bug lies with mysql_fetch_row_format.

Does anyone else have this problem?
__________________
super fun derby since 2009 - cnbderby.net:7777
michael2572 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 03:07 PM.


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