Mysql Loading issue
#1

This line [CellSystem[total][CellSQLID] = cache_get_field_content_int(i, "id");]does not seem to be loading for some reason because the print at the bottom shows this

Код:
[21:28:53] loop id: 45 | enum id: 0
[21:28:53] loop id: 46 | enum id: 0
[21:28:53] loop id: 47 | enum id: 0
[21:28:53] loop id: 48 | enum id: 0
[21:28:53] loop id: 49 | enum id: 0
[21:28:53] loop id: 50 | enum id: 0
Loading System

Код:
{
	new total, pickupmodel, LabelCell[258], InitialTicks = GetTickCount();
	for(new i = 0, r = cache_num_rows(); i < r; i++)
	{
		CellSystem[total][CellSQLID] = cache_get_field_content_int(i, "id");

		cache_get_field_content(i, "Cell_Name", CellSystem[total][CellName], g_iHandle, 128);

		CellSystem[total][CellLocked] = cache_get_field_content_int(i, "Cell_Locked");
		CellSystem[total][CellOwner] = cache_get_field_content_int(i, "Cell_Owner");
		CellSystem[total][CellPrice] = cache_get_field_content_int(i, "Cell_Price");
		CellSystem[total][CellLevel] = cache_get_field_content_int(i, "Cell_Level");
		CellSystem[total][CellWeaponOne] = cache_get_field_content_int(i, "Cell_Weapon_One");
		CellSystem[total][CellWeaponTwo] = cache_get_field_content_int(i, "Cell_Weapon_Two");
		CellSystem[total][CellWeed] = cache_get_field_content_int(i, "Cell_Weed");
		CellSystem[total][CellCoke] = cache_get_field_content_int(i, "Cell_Coke");

		CellSystem[total][CellEntPosX] = cache_get_field_content_float(i, "Cell_Ent_Pos_X");
		CellSystem[total][CellEntPosY] = cache_get_field_content_float(i, "Cell_Ent_Pos_Y");
		CellSystem[total][CellEntPosZ] = cache_get_field_content_float(i, "Cell_Ent_Pos_Z");
		CellSystem[total][CellExtPosX] = cache_get_field_content_float(i, "Cell_Ext_Pos_X");
		CellSystem[total][CellExtPosY] = cache_get_field_content_float(i, "Cell_Ext_Pos_Y");
		CellSystem[total][CellExtPosZ] = cache_get_field_content_float(i, "Cell_Ext_Pos_Z");

		CellSystem[total][CellLoaded] = 1;

		if(CellSystem[total][CellOwner] == -1) pickupmodel = 19522;
		else pickupmodel = 1273;

		CellSystem[total][CellPickup] = CreateDynamicPickup(pickupmodel, 23, CellSystem[total][CellEntPosX], CellSystem[total][CellEntPosY], CellSystem[total][CellEntPosZ], 0, -1, -1, 20.0);

		if(CellSystem[total][CellOwner] == -1) format(LabelCell, sizeof(LabelCell), "%s\n /buycell to buy this cell for $%d", CellSystem[total][CellName], CellSystem[total][CellPrice]);
		else format(LabelCell, sizeof(LabelCell), "%s\n Owner: %s | Cell level: %i | Cell Locked: %i", CellSystem[total][CellName], ReturnNameFromID(CellSystem[total][CellOwner]), CellSystem[total][CellLevel], CellSystem[total][CellLocked]);

		CellSystem[total][CellLabel] = CreateDynamic3DTextLabel(LabelCell, -1, CellSystem[total][CellEntPosX], CellSystem[total][CellEntPosY], CellSystem[total][CellEntPosZ]+0.5, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 0, -1, -1, 15.0);
    	total++;

    	printf("loop id: %i | enum id: %i", total, CellSystem[total][CellSQLID]);

	}
	printf("%i cells have been successfully loaded. [%i miliseconds]", cache_num_rows(), GetTickCount() - InitialTicks);
	return 1;
}
EDIT:

This is my mysql log too ?#

Код:
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
[21:33:09 03/02/17] [ERROR] cache_get_field_content_int - invalid datatype
Reply
#2

The error that the log prints by the 'id' field is not an Integer (Int).
Reply
#3

Quote:
Originally Posted by mcreed
Посмотреть сообщение
The error that the log prints by the 'id' field is not an Integer (Int).
It is in my database so why would it not be grabbing it as a int?
Reply
#4

Reply
#5

Could you pass a screen shot of the field?
Sorry, i used the ****** traductor for translate u.u

EDIT:
I look that you took a photo
Reply
#6

You can not teach more code, at least from where you do the consultation?
Reply
#7

eh? I don't understand
Reply
#8

Is your Column ID auto-increment?
If it not, it will explain why all CellID is 0.
Reply
#9

Yep it is

Reply
#10

Can anybody help me with this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)