[MySQL] Samp_mysql_getfield Crashes Server
#1

Код:
format(query,256,"SELECT * FROM `users` WHERE `username`='%s' AND `password`='%s'",playername,phash);
		samp_mysql_query(query);
		samp_mysql_store_result();
		new rows = samp_mysql_num_rows();
		if(rows != 1) return SendClientMessage(playerid,COLOR_RED,"Invalid Login - Please try again.");
		SendClientMessage(playerid,COLOR_LIME,"You have successfully logged in!");
		new fieldvalue[128];
		new field[128];
		new line[1024];
		samp_mysql_fetch_row(line);
		samp_mysql_get_field("username", fieldvalue);
		printf("%s ", fieldvalue);
		samp_mysql_get_field("money", fieldvalue);
		printf("%% ", fieldvalue);
The first "username" field gets printed into the cmd prompt, but then the second just crashes the server.
there arent any compiling errors, but when i /login (this is the /login code), the server crashes.
Please help!
Reply
#2

server log:
Код:
[17:26:51] Incomming connection: 71.238.180.253:13132
[17:26:51] [join] R4nk3d has joined the server (0:71.238.180.253)
[17:26:57] AmxLoad
[17:26:57] xStreamer: xStreamer filterscript has been detected
[17:26:57]  Filterscript 'xstreamer.amx' loaded.
[17:27:04] R4nk3d
it prints R4nk3d(username), but then after that crashes =/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)