SA-MP Forums Archive
[Help] MySQL Erros - 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: [Help] MySQL Erros (/showthread.php?tid=662917)



[Help] MySQL Erros - ApolloScripter - 15.01.2019

Hello everyone, I decided to learn MySQL and make my GM a little more practical, I followed tutorials but when testing, I come across some informalities and errors, such as those mentioned below:

PHP код:
warning 213tag mismatch
// On this Line
IDConexao mysql_connect(HOSTUSUARIOSENHADATABASE); 
PHP код:
warning 202number of arguments does not match definition
//On this Line
mysql_format(IDConexaoQuerysizeof(Query), "INSERT INTO `ContasScore`(`Nome`, `Score`) VALUES ('%s', '%i')"PlayerName(playerid), GetPlayerScore(playerid)); 
And Errors

PHP код:
error 017undefined symbol "mysql_tquery"
error 017undefined symbol "mysql_format"
//On these respective lines
mysql_tquery(IDConexaoQuery"DadosRegistrados""i"playerid);
mysql_format(IDConexaoQuerysizeof(Query), "UPDATE `ContasScore` SET `Nome`='%s', `Score`='%i' WHERE `ID`=%d"PlayerName(playerid), GetPlayerScore(playerid), PlayerInfoID[playerid]); 
There are other errors, but almost all are errors that do not recognize the command that is related to MySQL, I have already updated everything and even that did not help.


Re: [Help] MySQL Erros - Chyakka - 15.01.2019

Is your 'IDConexao' variable declared as a mysql variable?

When you make your variable you need to make sure it has the prefix MySQL:, so your variable would be:
Код:
new MySQL:IDConexao;



Re: [Help] MySQL Erros - ApolloScripter - 15.01.2019

Yes, it is.
PHP код:
new MySQL:IDConexao



Re: [Help] MySQL Erros - Chyakka - 15.01.2019

What mysql plugin are you using and what version is it?


Re: [Help] MySQL Erros - ApolloScripter - 15.01.2019

It is R41-4, using Windows version.


Re: [Help] MySQL Erros - rockys - 15.01.2019

#include mysql


Re: [Help] MySQL Erros - ApolloScripter - 15.01.2019

Quote:
Originally Posted by rockys
Посмотреть сообщение
#include mysql
Already included.


Re: [Help] MySQL Erros - rockys - 15.01.2019

where you use that syntax?
and first is mysql_format no tquery


Re: [Help] MySQL Erros - ApolloScripter - 15.01.2019

I used it normally in a file, so include it in GM like any other.

and "mysql_tquery", it's on another line, I just put it there to demonstrate, but I read that this is used to call some function or something like that, I may have misunderstood as well.


Re: [Help] MySQL Erros - ApolloScripter - 16.01.2019

Someone?