[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


Messages In This Thread
[MySQL] Samp_mysql_getfield Crashes Server - by tom_jonez - 20.03.2009, 21:29
Re: [MySQL] Samp_mysql_getfield Crashes Server - by tom_jonez - 20.03.2009, 23:23

Forum Jump:


Users browsing this thread: 1 Guest(s)