View Single Post
Author Message
LambdaLambda
AlliedModders Donor
Join Date: Oct 2010
Location: London
Old 10-15-2013 , 12:55   Error fetching data from field 1
Reply With Quote #1

Hey,

hope it's goint to be my last question. What's wrong with this piece of code?

http://pastebin.com/XamZLmGE
Code:
DajPkt(ilepkt)
{
	new String:sqlstring[255];
	Format(sqlstring, sizeof(sqlstring), "SELECT steamid FROM gocs_pkt WHERE ingame = '1'")
	SQL_LockDatabase(dbcon);     
	new Handle:sql3 = SQL_Query(dbcon, sqlstring);
	while(SQL_FetchRow(sql3))
	{
		SQL_UnlockDatabase(dbcon);
		new String:sid[50];
		SQL_FetchString(sql3, 1, sid, sizeof(sid));
		CloseHandle(sql3);

		SQL_UnlockDatabase(dbcon);

		Format(sqlstring, sizeof(sqlstring), "UPDATE pfields_content SET eco_points = eco_points + '%i' AND eco_worth = eco_worth + '%i' WHERE %s = '%s'", ilepkt, ilepkt, sidpole, sid);
		SQL_Query(dbconipb, sqlstring);
	}
	
	CloseHandle(sql3);

	SQL_UnlockDatabase(dbcon);
}
It compiles well, but gives me feedback:
Quote:
L 0/15/2013 - 17:53:48:1 [SM] Native "SQL_FetchString" reported: Error fetching data from field 1
LambdaLambda is offline