[HELP]Function MYSQL .
#1

Hello guys, i have a problem to get a code from the player, who we see the image.




I want to get only with "Nb30Nu61" , I'm using this code to get :

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



main () { print("ligado"); }

new MQ;

public OnGameModeInit() {
        MQ = mysql_connect("localhost", "host", "bancodedados", "senha");
	return 1;
}

public OnGameModeExit() {

	mysql_close(MQ);
	return 1;
}

public OnPlayerConnect(playerid) {
	new bola[128];
	cache_get_field_content(1, "Code_Recupera", bola);
	printf("testando  %s", bola); // 
	return 1;
}
but only printed this "testando" , I do not know if I'm making out correct or not , tell me , how I can get that code.

Obs : I using This Function correctly , here.

Thanks , Sorry bad Englesh .
Reply
#2

First things first: HASH THE PASSWORDS! Do it now!

And no, you are not using this function correctly. I don't even see a related query.
Reply
#3

You didn't send a query to MySQL yet to get the data.
cache_get_field_content only works if you sent a query first.
The result of the query would be placed in a cache, from which you can get the field contents.
Reply
#4

how to make a query, can you explain?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)