SA-MP Forums Archive
[MySQL] How to get the next row data? - 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: [MySQL] How to get the next row data? (/showthread.php?tid=487969)



[MySQL] How to get the next row data? - jeffleung2 - 16.01.2014

here is my code
Код:
public OnQueryFinish(query[], resultid, extraid, connectionHandle)
{
	if(resultid == CreateTask)
	{
		new result[100], result2[100];
		printf(query);
		mysql_store_result();
	 	mysql_fetch_row_format(result, " ");
	 	printf("result:%s",result);
	 	while(mysql_retrieve_row())
	 	{
	 		mysql_store_result();
			mysql_fetch_row_format(result2, " ");
	 		printf("result:%s",result2);
		}
		mysql_free_result();
	}
	return 1;
}
why i cannot get the next row data?
How should i get it?


Re: [MySQL] How to get the next row data? - Vince - 16.01.2014

pawn Код:
mysql_store_result(); // store result once, before processing
while(mysql_fetch_row_format(result2, " ")) // Are you sure you're using a space as delimiter?
{
    printf("result: %s", result2);
}
mysql_free_result(); // free result once, after processing



Re: [MySQL] How to get the next row data? - jeffleung2 - 16.01.2014

Quote:
Originally Posted by Vince
Посмотреть сообщение
pawn Код:
mysql_store_result(); // store result once, before processing
while(mysql_fetch_row_format(result2, " ")) // Are you sure you're using a space as delimiter?
{
    printf("result: %s", result2);
}
mysql_free_result(); // free result once, after processing
Thanks a lot!!!!!
samp mysql is pretty hard
thanks for helping!