SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 06/12/2016, 09:44 AM   #6031
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,828
Reputation: 1401
Default Re: [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by RIDE2DAY View Post
[..]
Should cache_get_result_count and cache_get_row_count be used first as a condition always? Why would they fail? I mean, is there any difference between the following two examples?
PHP Code:
// CODE 
No, it shouldn't. Use the cache-result functions only when you execute multiple queries at once so in the 2 examples above, simply check if there are rows and only that.
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 06/12/2016, 01:52 PM   #6032
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,828
Reputation: 1401
Default Re: [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by RIDE2DAY View Post
I understand, thank you. How are multiple queries sent with this plugin btw?
Each one of them are separated by a semicolon.
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 09/12/2016, 03:45 PM   #6033
Doritoss
Little Clucker
 
Join Date: Jul 2016
Posts: 5
Reputation: 0
Default Re: [REL] MySQL Plugin (Now on github!)

The mysql_log function doesn't work with R41-2.

Code:
error 017: undefined symbol "LOG_ERROR"
__________________
Doritoss is offline   Reply With Quote
Old 09/12/2016, 03:59 PM   #6034
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,828
Reputation: 1401
Default Re: [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by Doritoss View Post
The mysql_log function doesn't work with R41-2.

Code:
error 017: undefined symbol "LOG_ERROR"
http://wiki.sa-mp.com/wiki/MySQL/R40#Log_levels
http://forum.sa-mp.com/showthread.php?t=616103
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 10/12/2016, 12:20 PM   #6035
Riddick94
Banned
 
Join Date: Mar 2010
Location: Poland
Posts: 1,767
Reputation: 223
Default Re: [REL] MySQL Plugin (Now on github!)

Just recently got into my script and started updating all the plugins. When I went from 39 to the current version, I had so many errors regarding mysql_format_query etc. no info found on this one, why it has been removed tough, looks like it "just" has.

Fine, moved on the mysql_tquery function and this doesn't even execute.

pawn Code:
[...] - check edit2://

That is pretty much copy & paste of the Wiki code. Callback doesn't return any prints.

edit://
Also, it started crashing the server when I did "Ctrl + C" in the console. Where it didn't do it previously. No logs stored tough.

edit2://
Just checked if the connection to the MySQL is alive - it doesn't connect to the database. It was connecting sucessfully before the upgrade.

pawn Code:
SerwerData[E_SERWER_MYSQL] = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DATA, MYSQL_PASS);

    if(SerwerData[E_SERWER_MYSQL] && mysql_errno(SerwerData[E_SERWER_MYSQL]) == 0)
    {
        printf("[MySQL]: Connection to database [%s] successfully established!", MYSQL_DATA);
    }
   
    else
    {
        printf("[MySQL]: Connection to database [%s] failed!", MYSQL_DATA);
    }

Says it fails now.

edit3://


Seriously? Piss off.

Last edited by Riddick94; 10/12/2016 at 01:16 PM.
Riddick94 is offline   Reply With Quote
Old 10/12/2016, 01:19 PM   #6036
maddinat0r
Banned
 
Join Date: Jun 2010
Location: Germany
Posts: 845
Reputation: 482
Default Re: [REL] MySQL Plugin (Now on github!)

Read the conversion tutorial: http://forum.sa-mp.com/showthread.php?t=616103
Also "mysql_function_query" (there is no such thing as "mysql_format_query") is deprecated since R21 I think.
maddinat0r is offline   Reply With Quote
Old 10/12/2016, 01:21 PM   #6037
Riddick94
Banned
 
Join Date: Mar 2010
Location: Poland
Posts: 1,767
Reputation: 223
Default Re: [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by maddinat0r View Post
Read the conversion tutorial: http://forum.sa-mp.com/showthread.php?t=616103
Also "mysql_function_query" (there is no such thing as "mysql_format_query") is deprecated since R21 I think.
Yeah, I read that thread. Edited my post before you posted it. Meant function_query tough, but it was still in R30something, since that was the version I was using before I did an upgrade today to your latest one.

Thanks tough.
Riddick94 is offline   Reply With Quote
Old 10/12/2016, 10:09 PM   #6038
maddinat0r
Banned
 
Join Date: Jun 2010
Location: Germany
Posts: 845
Reputation: 482
Default Re: [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by Riddick94 View Post
Yeah, I read that thread. Edited my post before you posted it. Meant function_query tough, but it was still in R30something, since that was the version I was using before I did an upgrade today to your latest one.

Thanks tough.
I've added backward-compatibility macros around R21 (same time I've added mysql_tquery), and removed them completely in R40. Maybe you've just read a wrong tutorial which still used/suggested the old function. Still, no reason to be hostile ("Seriously? Piss off.") just because I did a code-breaking release three years after the last one. I agree that the code-breaking change in mysql_connect, where the password and database parameter being swapped, is a really strange one (especially because it doesn't cause any compile errors). But really it should have been so from the very beginning, because MySQL itself does it in that order (every account validation comes in a username - password pair; how does username - database - password make sense?).
I agree that code-breaking changes are really troublesome, and no scripter likes to convert his whole ~100K lines long gamemode simply to adapt to a new plugin version. But in reality, this has to be done sometime, especially in a rapidly developing community like SA-MP.
You also don't have to update to R40+ if you don't need the new features.
maddinat0r is offline   Reply With Quote
Old 11/12/2016, 01:43 PM   #6039
Sgt.TheDarkness
Banned
 
Join Date: Jun 2012
Location: Moscow, Russia.
Posts: 252
Reputation: 50
Default Re: [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by maddinat0r View Post
I've added backward-compatibility macros around R21 (same time I've added mysql_tquery), and removed them completely in R40. Maybe you've just read a wrong tutorial which still used/suggested the old function. Still, no reason to be hostile ("Seriously? Piss off.") just because I did a code-breaking release three years after the last one. I agree that the code-breaking change in mysql_connect, where the password and database parameter being swapped, is a really strange one (especially because it doesn't cause any compile errors). But really it should have been so from the very beginning, because MySQL itself does it in that order (every account validation comes in a username - password pair; how does username - database - password make sense?).
I agree that code-breaking changes are really troublesome, and no scripter likes to convert his whole ~100K lines long gamemode simply to adapt to a new plugin version. But in reality, this has to be done sometime, especially in a rapidly developing community like SA-MP.
You also don't have to update to R40+ if you don't need the new features.
Or maybe you don't understand the word "compatibility". You've done so much to ruin the plugin in my opinion, people have very GOOD reason to be mad & hostile at you for these dumb changes. The log plugin is well... not really needed in the first place if you do proper debugging. Secondly, all the function change was far from necessary, if it isn't broken, don't fucking fix it.


We've forked our own version of R39-6, as stated previously.
Sgt.TheDarkness is offline   Reply With Quote
Old 18/12/2016, 04:18 PM   #6040
Max_Andolini
Huge Clucker
 
Max_Andolini's Avatar
 
Join Date: Oct 2013
Posts: 318
Reputation: 37
Default Re: [REL] MySQL Plugin (Now on github!)

Solved.
Max_Andolini 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 11:57 PM.


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