Besoin d'aide pour MySQL.
#1

Bonjour, j'essaye vraiment d'utilisй MYSQL.

Je connais le SQL avec PHP, mais je n'arrive pas а m'en servir sur SA:MP.

Voilа mes codes :

Code:
#include <a_samp>
#include <a_mysql>

// MANQUE DE CODE 

#define MYSQL_HOST "localhost"
#define MYSQL_USER "root"
#define MYSQL_PASS ""
#define MYSQL_DB "samp"

// Serveur
public OnGameModeInit()
{
	// Connexion MYSL
	mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS);
    mysql_select_db(MYSQL_DB);
return 1;
}
Code:
public OnPlayerSpawn(playerid)
{
	// Rйcupйration du skin.
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid,name,sizeof(name));
	new string[128];
	format(string, sizeof(string), "SELECT Skins FROM compte WHERE Pseudo = '%s'", name);
	mysql_query(string);
	mysql_store_result();

	new strid[32];
    mysql_fetch_row(strid);
    players[playerid][Skins] = strval(strid);

	SetPlayerSkin(playerid, players[playerid][Skins]); // On met sont skin.
Erreur :
Code:
C:\Users\Noliax8\Desktop\SERV\gamemodes\gm.pwn(86) : warning 202: number of arguments does not match definition // mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS);
C:\Users\Noliax8\Desktop\SERV\gamemodes\gm.pwn(87) : error 017: undefined symbol "mysql_select_db"
C:\Users\Noliax8\Desktop\SERV\gamemodes\gm.pwn(181) : error 017: undefined symbol "mysql_query"
C:\Users\Noliax8\Desktop\SERV\gamemodes\gm.pwn(541) : warning 203: symbol is never used: "admin"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Je sais que j'utilise surement pas les bonnes fonction, mais j'ai vraiment besoin d'aide. J'utilise le plugins de BlueG
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)