ajuda mysql
#3

Код:
#include <a_samp>
#include <a_mysql>
#include <zcmd>


//MySQL defines. Tweak them where needed.

#define SQL_HOST "localhost"

#define SQL_USER "root"

#define SQL_DB "programas"

#define SQL_PASS "root"
//new pName[MAX_PLAYER_NAME];


public OnFilterScriptInit()
{
    mysql_debug(1);
    mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
	print("\n_____________________________");
	print("| HidMin                    |");
	print("|   Crappy MySQL admin FS   |");
	print("|                  Loading  |");
	if( mysql_ping() == 1 ) print("|_MySQL:_Connected!______ __|");
	else print("|_MySQL:_Failed_to_connect__|");
	return 1;
}



public OnFilterScriptExit()
{
	mysql_close();
	return 1;
}

stock InicioConexao(playerid)
{
    new Query[90],EscName[MAX_PLAYER_NAME];
	
	mysql_real_escape_string(pName(playerid), EscName);
	format(Query, sizeof(Query), "SELECT * FROM `conta` WHERE `Nome` = '%s'", EscName);
	mysql_query(Query);
    mysql_store_result();
	if(mysql_num_rows() != 0)
    {
		print("utilizador conectado");
    }
    	else
    {
       print("nao conectado a base de dados");
       Kick(playerid);
    }
    mysql_free_result();
}

public OnPlayerConnect(playerid)
{
	InicioConexao(playerid);
}
eu fiz umas modificaзхes no codigo mas ele nгo estб a funcionar.

dб este erro
Код:
C:\Users\portatil\Desktop\New Folder\pawno\mysqlfinal.pwn(38) : error 017: undefined symbol "pName"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
eu estou a fazer em filterscript, se calhar йpor isso!
Reply


Messages In This Thread
ajuda mysql - by emanuelx - 05.03.2011, 16:08
Re: ajuda mysql - by kariok - 05.03.2011, 19:25
Re: ajuda mysql - by emanuelx - 06.03.2011, 12:14

Forum Jump:


Users browsing this thread: 3 Guest(s)