Mysql - mismatch
#1

Welcome back
I'm using mysql-R40 and I have (23)warning 213: tag mismatch:

Код HTML:
new sql;
PHP код:
public OnGameModeInit()
{
 (
23sql mysql_connect("localhost""user""db""123");
    if(
mysql_errno() != 0)
    {
        print(
"Error connection failed");
    }
    return 
1;

Reply
#2

Код:
new MySQL:sql;
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
Reply
#3

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);
Reply
#4

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. :/
Reply
#5

Sequence of parameters is wrong.

Код:
sql = mysql_connect("localhost", "user", "db", "123"); 
Correct:

Код:
sql = mysql_connect("localhost", "user","123", "db"); 
Reply
#6

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(SqlGMsampsizeof(samp), "SELECT * from 'players' WHERE 'nick' LIKE BINARY '%s'"GetPlayerNick(playerid)); 
Reply
#7

Quote:
Originally Posted by Oficer
Посмотреть сообщение
Okey thanks
What in this line is wrong?

warning 213: tag mismatch

PHP код:
mysql_format(SqlGMsampsizeof(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));
Reply
#8

Thanks bro!
Reply
#9

Escape all your strings using %e instead of %s within MySQL queries.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)