SA-MP Forums Archive
MySQL problem : How to get the 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 problem : How to get the data ?! (/showthread.php?tid=460550)



MySQL problem : How to get the data ?! - urbanghetto - 29.08.2013

Hi everyone,

I'm lost with the new cache system for MySQL, here is my code :

Код:
mysql_function_query(g_Handle, "SELECT COUNT(*) FROM `vehicles`", true, "GetNumberOfColumns","");
I have 2 columns in my vehicles table, so this function should return 2 as result data, but where is this data stored ? And how can I get it ?

I tried this :

Код:
forward GetNumberOfColumns();
public GetNumberOfColumns()
{
	new rows, fields;
        cache_get_data(rows, fields);

	new String[15];
	format(String,sizeof(String),"%i %i",rows,fields);
	SendClientMessageToAll(-1,String);
}
This writes "1 1" ingame none of the two variables are correct because the query should return the data 2

I'm lost can anyone help me ?

Thanks.