SA-MP Forums Archive
[HELP]Function MYSQL . - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP]Function MYSQL . (/showthread.php?tid=500742)



[HELP]Function MYSQL . - shittt - 14.03.2014

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 .


Re: [HELP]Function MYSQL . - Vince - 14.03.2014

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.


Re: [HELP]Function MYSQL . - PowerPC603 - 14.03.2014

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.


Re: [HELP]Function MYSQL . - shittt - 15.03.2014

how to make a query, can you explain?