A question
#1

Hello,

I am currently using MySQL R38 and i am doing this to load my house data

Код:
LoadHouses()
{
    new query[36], Cache:result, id;
    
    mysql_format(mysql, query, sizeof(query), "SELECT * FROM `houses`");
	result = mysql_query(mysql, query);
	
	if (cache_get_row_count() >= 1)
	{
	    for (new i; i < cache_get_row_count(); ++i)
 		{
	        id = cache_get_field_content_int(i, "id");
	        cache_get_field_content(i, "name", hInfo[id][h_Name], mysql, 100);
		    cache_get_field_content(i, "owner", hInfo[id][h_Owner], mysql, 24);
			hInfo[id][h_X] = cache_get_field_content_float(i, "x");
			hInfo[id][h_Y] = cache_get_field_content_float(i, "y");
			hInfo[id][h_Z] = cache_get_field_content_float(i, "z");
			hInfo[id][h_Level] = cache_get_field_content_int(i, "level");
			hInfo[id][h_MaxLevel] = cache_get_field_content_int(i, "maxlevel");
			hInfo[id][h_Price] = cache_get_field_content_int(i, "price");
			hInfo[id][h_Owned] = cache_get_field_content_int(i, "owned");
			hInfo[id][h_Insur] = cache_get_field_content_int(i, "ins");
			hInfo[id][h_Locked] = 1;
			CreateHouseEntrance(id);
			g_ServerData[TotalHouses]++;
		}
		cache_delete(result, mysql);
	}
	else return 0;
    return 1;
}
Is this the correct way to do so? I don't really know stuffs about cache so i would like to know.

Also,

I am sending queries like mysql_tquery(conn, query, "", ""); to update something in the databas. Which one would be better to use? This one or mysql_query(conn, query, false); ?

I am kinda confused with these 2 stuffs for a long time and i couldn't really find any good explanation for them.
Reply
#2

/Bump, anyone can help please?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)