SA-MP Forums Archive
Getting an error involving MySQL - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Getting an error involving MySQL (/showthread.php?tid=640518)



Getting an error involving MySQL - NathanT - 03.09.2017

When I try to use a new version of MySQL (some version above R7) the compiler gives me a lot of errors when I try to compile my gamemode:
Код:
warning 219: local variable "str" shadows a variable at a preceding level
warning 219: local variable "str" shadows a variable at a preceding level
warning 219: local variable "str" shadows a variable at a preceding level
warning 219: local variable "str" shadows a variable at a preceding level
warning 219: local variable "str" shadows a variable at a preceding level
warning 219: local variable "str" shadows a variable at a preceding level
warning 219: local variable "str" shadows a variable at a preceding level
warning 219: local variable "str" shadows a variable at a preceding level
warning 219: local variable "str" shadows a variable at a preceding level
warning 219: local variable "str" shadows a variable at a preceding level
warning 219: local variable "str" shadows a variable at a preceding level
warning 219: local variable "str" shadows a variable at a preceding level
warning 219: local variable "str" shadows a variable at a preceding level
warning 219: local variable "str" shadows a variable at a preceding level
warning 219: local variable "str" shadows a variable at a preceding level
error 021: symbol already defined: "mysql_escape_string"
error 001: expected token: "=", but found "["
error 021: symbol already defined: "mysql_escape_string"
error 010: invalid function or declaration
error 017: undefined symbol "mysql_function_query"
warning 219: local variable "str" shadows a variable at a preceding level
warning 219: local variable "str" shadows a variable at a preceding level
warning 219: local variable "str" shadows a variable at a preceding level
warning 219: local variable "str" shadows a variable at a preceding level
warning 219: local variable "string" shadows a variable at a preceding level
warning 219: local variable "str" shadows a variable at a preceding level
error 028: invalid subscript (not an array or too many subscripts): "string"
error 029: invalid expression, assumed zero
error 028: invalid subscript (not an array or too many subscripts): "string"
fatal error 107: too many error messages on one line
If I try to compile the gamemode with MySQL Plugin version R7, I don't get these errors, I only get these errors if I change my MySQL for other version different of R7. Can somebody help me with this error? I opened "a_mysql" to check it and I didn't find nothing wrong. I tested with many other versions of MySQL plugin and always I got these errors with versions above of R7.


Re: Getting an error involving MySQL - Luke_James - 03.09.2017

Are the errors coming from your gamemode, or from an include? If they're coming from your gamemode, provide the code please; we can't see what you've done wrong without the code.

str is a common string variable and can conflict with existing includes / code libraries if incorrectly implemented in your own code.


Re: Getting an error involving MySQL - Vince - 03.09.2017

Anything above R7 is not backward compatible with R7. You cannot just plop in R41 and expect it to still work.


Re: Getting an error involving MySQL - NathanT - 04.09.2017

Quote:
Originally Posted by Luke_James
Посмотреть сообщение
Are the errors coming from your gamemode, or from an include? If they're coming from your gamemode, provide the code please; we can't see what you've done wrong without the code.

str is a common string variable and can conflict with existing includes / code libraries if incorrectly implemented in your own code.
I don't know from where and why is coming this error, the include file (a_mysql.inc) and the gamemode are ok.
Usually that error is caused due unclosed brackets, I guess, and there are not unclosed brackets.

Quote:
Originally Posted by Vince
Посмотреть сообщение
Anything above R7 is not backward compatible with R7. You cannot just plop in R41 and expect it to still work.
I tried R38 version out too and I still got this error. Maybe would be normal getting errors like "undefined symbol..." due to the name of functions have been changed, but I got errors even in other include.


Re: Getting an error involving MySQL - Luke_James - 04.09.2017

Sorry, I didn't read the OP in the first place, just the errors.

You can't upgrade from R7 to R3x/40+ without making significant changes to your code, there are plenty of guides and tutorials on the forum which comprehensively show you the changes you need to make.


Re: Getting an error involving MySQL - NathanT - 04.09.2017

Damn, so I'll back to use R7 version. Thank you both for intention in helping


Re: Getting an error involving MySQL - Luke_James - 04.09.2017

... or you can update your code