doubt,what's wrong?
#1

Hi, i tried to move this system to the last version of MySQL, Could somebody tell me if it's okay?

Mysql Old Version Old
Код:
funcion CargarEntradas()
{
	new linea[1024];
	new idx;
	mysql_query("SELECT * FROM entradas ORDER BY Id ASC");
	mysql_store_result();
	while(mysql_fetch_row(linea))
	{
 		new info[3];
   		new infos[1][30];
	    new Float:infof[6];
	    unformat(linea,"p<|>dffffffdds[30]",info[0],infof[0],infof[1],infof[2],infof[3],infof[4],infof[5],
		info[1],info[2],infos[0]);
		idx = info[0];
		InfoEntr[idx][entrSQLId] = info[0];
		InfoEntr[idx][entrX] = infof[0];
		InfoEntr[idx][entrY] = infof[1];
		InfoEntr[idx][entrZ] = infof[2];
		InfoEntr[idx][entrSX] = infof[3];
		InfoEntr[idx][entrSY] = infof[4];
		InfoEntr[idx][entrSZ] = infof[5];
		InfoEntr[idx][entrInt] = info[1];
		InfoEntr[idx][entrVW] = info[2];
  		//__________fin___________//
  		Iter_Add(Entrada,idx);
  		CreatePickup(1318, 1, InfoEntr[idx][entrX],InfoEntr[idx][entrY],InfoEntr[idx][entrZ], 0);
  		CreateDynamic3DTextLabel("Escribe {DBED15}/salir {FFFFFF}para salir",color_blanco,InfoEntr[idx][entrSX],InfoEntr[idx][entrSY],InfoEntr[idx][entrSZ]+0.6,5);
	}
	printf("   Entradas cargadas = %d\n",idx);
	mysql_free_result();
	return 1;
}
Version New
Код:
CargarEntradas()
{
	new Cache:ce = mysql_query(TU_CONEXION_ID, "SELECT * FROM entradas ORDER BY Id ASC");
	new i = cache_num_rows(), id;
	if(i > 0)
	{
		for(new r = 0, rj = i; r < rj; r++)
		{
			cache_get_value_index_int(r, 0, id);
			InfoEntr[id][entrSQLId] = id;
			//
			cache_get_value_index_float(r, 1, InfoEntr[id][entrX]);
			cache_get_value_index_float(r, 2, InfoEntr[id][entrY]);
			cache_get_value_index_float(r, 3, InfoEntr[id][entrZ]);
			cache_get_value_index_float(r, 4, InfoEntr[id][entrSX]);
			cache_get_value_index_float(r, 5, InfoEntr[id][entrSY]);
			cache_get_value_index_float(r, 6 InfoEntr[id][entrSZ]);
			cache_get_value_index_int(r, 7, InfoEntr[id][entrInt]);
			cache_get_value_index_int(r, 8, InfoEntr[id][entrVW]);		
  			//__________fin___________//
  			Iter_Add(Entrada,id);
  			CreatePickup(1318, 1, InfoEntr[id][entrX],InfoEntr[id][entrY],InfoEntr[id][entrZ], 0);
  			CreateDynamic3DTextLabel("Escribe {DBED15}/salir {FFFFFF}para salir",color_blanco,InfoEntr[id][entrSX],InfoEntr[id][entrSY],InfoEntr[id][entrSZ]+0.6,5);
  		}
	}
	printf("   Entradas cargadas = %d\n",i);
	cache_delete(ce);
	return 1;
}
Console said me it's wrong and don't let me put the entrances
Код:
Entradas cargadas = 0
Reply
#2

Use threaded queries and that's not the proper way to load something.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)