Mysql - mismatch - 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: Mysql - mismatch (
/showthread.php?tid=641665)
Mysql - mismatch -
Oficer - 18.09.2017
Welcome back
I'm using mysql-R40 and I have (23)warning 213: tag mismatch:
PHP код:
public OnGameModeInit()
{
(23) sql = mysql_connect("localhost", "user", "db", "123");
if(mysql_errno() != 0)
{
print("Error connection failed");
}
return 1;
}
Respuesta: Mysql - mismatch -
!R1Ch@rD! - 18.09.2017
it works for you like this? I've never used MySQL, but just the same here I leave the link where I saw this.
https://sampwiki.blast.hk/wiki/MySQL/R40
Re: Mysql - mismatch -
Hansrutger - 18.09.2017
There's no tag for "connection" variables (if that's how you can call them). I believe you are forgetting the port, default one is 3306, example:
Код:
dbcon = mysql_connect("localhost", "user", "db", "123", 3306);
Re: Mysql - mismatch -
Oficer - 18.09.2017
I edited on "new MySQL:sql;" - but when I add port, warrning returned, moreover server does not connect. This is my first time in mysql, and I don't know what is wrong. :/
Re: Mysql - mismatch -
IlanZ - 18.09.2017
Sequence of parameters is wrong.
Код:
sql = mysql_connect("localhost", "user", "db", "123");
Correct:
Код:
sql = mysql_connect("localhost", "user","123", "db");
Re: Mysql - mismatch -
Oficer - 19.09.2017
Quote:
Originally Posted by IlanZ
Sequence of parameters is wrong.
Код:
sql = mysql_connect("localhost", "user", "db", "123");
Correct:
Код:
sql = mysql_connect("localhost", "user","123", "db");
|
Okey thanks
What in this line is wrong?
warning 213: tag mismatch
PHP код:
mysql_format(SqlGM, samp, sizeof(samp), "SELECT * from 'players' WHERE 'nick' LIKE BINARY '%s'", GetPlayerNick(playerid));
Respuesta: Re: Mysql - mismatch -
!R1Ch@rD! - 19.09.2017
Quote:
Originally Posted by Oficer
Okey thanks
What in this line is wrong?
warning 213: tag mismatch
PHP код:
mysql_format(SqlGM, samp, sizeof(samp), "SELECT * from 'players' WHERE 'nick' LIKE BINARY '%s'", GetPlayerNick(playerid));
|
Код:
mysql_format(SqlGM, samp, sizeof(samp), "SELECT * FROM `players` WHERE `nick` = '%s'", GetPlayerNick(playerid));
Re: Mysql - mismatch -
Oficer - 19.09.2017
Thanks bro!
Re: Mysql - mismatch -
Meller - 19.09.2017
Escape all your strings using %e instead of %s within MySQL queries.