Trivial MYSQL problem.
#1

Hey. I've a problem with MySQL. I'm starting to learn how to use Mysql and there is no real tutoriel to use it.. so I try to learn by myself. Actually, the problem is i've a warning for this :
PHP код:
#define SQL_HOST "localhost"
#define SQL_USER "root"
#define SQL_PASS ""
#define SQL_DB "gm"
static MySQL;
public 
OnGameModeInit()
{
    
MySQL mysql_connect(SQL_HOSTSQL_USERSQL_DBSQL_PASS); // This line 
Код:
warning 213: tag mismatch
I don't understand why.
Reply
#2

It should be:

PHP код:
static DB:MySQL
Reply
#3

R40+ version of the plugin uses MySQL: tag for connection handle: https://sampwiki.blast.hk/wiki/MySQL/R40#mysql_connect

@Kaliber: DB tag is for SQLite.
Reply
#4

Thanks for you help.
Also I've an another problem even if I check the wiki, I do the same the thing and I've an error. >.<
PHP код:
    new query[200];
    
mysql_format(MySQLquerysizeof(query), "UPDATE `Users` SET `Kills` = %d"GetPlayerScore(playerid)*2);
    
mysql_query(query); 
Код:
error 035: argument type mismatch (argument 1)
Код:
mysql_query(query[], resultid, extraid, connectionHandle)
What is wrong?
Reply
#5

Код:
mysql_format(MySQL, query, sizeof(query), "UPDATE `Users` SET `Kills` = '%d'", GetPlayerScore(playerid)*2);
mysql_query(,MySQL,query);
Reply
#6

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
Also I've an another problem even if I check the wiki, I do the same the thing and I've an error.
Check the wiki on the link I posted, the other two pages that exist are for R5 to R6-2 and R33+

About the last post, the plugin failed to load. Is it Windows or Linux? If it is Windows, do you have libmysqld.dll and log-core.dll into the main directory?
Reply
#7

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Check the wiki on the link I posted, the other two pages that exist are for R5 to R6-2 and R33+

About the last post, the plugin failed to load. Is it Windows or Linux? If it is Windows, do you have libmysqld.dll and log-core.dll into the main directory?
I wasn't on the correct version. I didn't saw it, my bad.

Windows! I have both of these file in the main directory (if you mean before folder plugins, pawno, etc...).
Reply
#8

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
I wasn't on the correct version. I didn't saw it, my bad.

Windows! I have both of these file in the main directory (if you mean before folder plugins, pawno, etc...).
BUMP!
Reply
#9

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
Windows! I have both of these file in the main directory (if you mean before folder plugins, pawno, etc...).
Do you get a missing .dll file when starting the server? It requires Microsoft Visual C++ 2015 Redistributable Package (x86 version).
Reply
#10

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Do you get a missing .dll file when starting the server? It requires Microsoft Visual C++ 2015 Redistributable Package (x86 version).
Thanks you.
I can't connect to my database. '-'
PHP код:
#define    MYSQL_HOST        "localhost" 
#define    MYSQL_USER        "root" 
#define    MYSQL_DATABASE    "myserver" 
#define    MYSQL_PASSWORD    "" 
static MySQL:MySQL;
public 
OnGameModeInit() 

    
//mysql_log(LOG_ALL); 
    
MySQL mysql_connect(MYSQL_HOSTMYSQL_USERMYSQL_DATABASEMYSQL_PASSWORD); 
    if(
mysql_errno() != 0
    { 
        
printf("[MySQL] The connection has failed."); 
    } 
    else 
    { 
        
printf("[MySQL] The connection was successful."); 
    } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)