MySQL Help
#1

Код:
new idx = 0;
	new fsalario;
	new frank;
	new savingstring[20];
	printf("DynamicFactionsSalario - Teste????");
	while (idx < 11)
	{
		new sql[128];
                printf("DynamicFactionsSalario - Teste????");
		format(sql, sizeof(sql), "SELECT * FROM `factionsalario` WHERE 'factionid'='%d'",idx);
		mysql_query(sql);
		mysql_store_result();
		while(mysql_retrieve_row())
		{
        	mysql_fetch_field_row(savingstring, "salario"); fsalario=strval(savingstring);
        	mysql_fetch_field_row(savingstring, "rank"); frank=strval(savingstring);
        	DynamicFactionsSalario[idx][frank]=fsalario;
        	printf("DynamicFactionsSalario[%d][%d]=%d;",idx,frank,fsalario);
		}
    	mysql_free_result();
    	idx=idx+1;
	}
Well, I've been testing it, and the script that is inside of "while(mysql_retrieve_row())" doesn't load.. Why "while(mysql_retrieve_row())" doesn't work?
Reply
#2

Found the problem.

In "WHERE 'factionid'='%d'", I must use "WHERE 'factionid'=%d"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)