Entrance_Save(entranceid)
{
static query[1024];
format(query, sizeof(query), "UPDATE `entrances` SET `entranceName` = '%s', `entrancePass` = '%s', `entranceIcon` = '%d', `entranceLocked` = '%d', `entrancePosX` = '%.4f', `entrancePosY` = '%.4f', `entrancePosZ` = '%.4f', `entrancePosA` = '%.4f', `entranceIntX` = '%.4f', `entranceIntY` = '%.4f', `entranceIntZ` = '%.4f', `entranceIntA` = '%.4f', `entranceInterior` = '%d', `entranceExterior` = '%d', `entranceExteriorVW` = '%d', `entranceType` = '%d'",
SQL_ReturnEscaped(EntranceData[entranceid][entranceName]),
SQL_ReturnEscaped(EntranceData[entranceid][entrancePass]),
EntranceData[entranceid][entranceIcon],
EntranceData[entranceid][entranceLocked],
EntranceData[entranceid][entrancePos][0],
EntranceData[entranceid][entrancePos][1],
EntranceData[entranceid][entrancePos][2],
EntranceData[entranceid][entrancePos][3],
EntranceData[entranceid][entranceInt][0],
EntranceData[entranceid][entranceInt][1],
EntranceData[entranceid][entranceInt][2],
EntranceData[entranceid][entranceInt][3],
EntranceData[entranceid][entranceInterior],
EntranceData[entranceid][entranceExterior],
EntranceData[entranceid][entranceExteriorVW],
EntranceData[entranceid][entranceType]
);
format(query, sizeof(query), "%s, `entranceCustom` = '%d', `entranceWorld` = '%d' WHERE `entranceID` = '%d'",
query,
EntranceData[entranceid][entranceCustom],
EntranceData[entranceid][entranceWorld],
EntranceData[entranceid][entranceID]
);
return mysql_function_query(sqlHandle, query, false, "", "");
}
forward Entrance_Load();
public Entrance_Load()
{
static
rows,
fields;
cache_get_data(rows, fields, g_iHandle);
for (new i = 0; i < rows; i ++) if (i < MAX_ENTRANCES)
{
EntranceData[i][entranceExists] = true;
EntranceData[i][entranceID] = cache_get_field_int(i, "entranceID");
cache_get_field_content(i, "entranceName", EntranceData[i][entranceName], g_iHandle);
cache_get_field_content(i, "entrancePass", EntranceData[i][entrancePass], g_iHandle);
EntranceData[i][entranceIcon] = cache_get_field_int(i, "entranceIcon");
EntranceData[i][entranceLocked] = cache_get_field_int(i, "entranceLocked");
EntranceData[i][entrancePos][0] = cache_get_field_float(i, "entrancePosX");
EntranceData[i][entrancePos][1] = cache_get_field_float(i, "entrancePosY");
EntranceData[i][entrancePos][2] = cache_get_field_float(i, "entrancePosZ");
EntranceData[i][entrancePos][3] = cache_get_field_float(i, "entrancePosA");
EntranceData[i][entranceInt][0] = cache_get_field_float(i, "entranceIntX");
EntranceData[i][entranceInt][1] = cache_get_field_float(i, "entranceIntY");
EntranceData[i][entranceInt][2] = cache_get_field_float(i, "entranceIntZ");
EntranceData[i][entranceInt][3] = cache_get_field_float(i, "entranceIntA");
EntranceData[i][entranceInterior] = cache_get_field_int(i, "entranceInterior");
EntranceData[i][entranceExterior] = cache_get_field_int(i, "entranceExterior");
EntranceData[i][entranceExteriorVW] = cache_get_field_int(i, "entranceExteriorVW");
EntranceData[i][entranceType] = cache_get_field_int(i, "entranceType");
EntranceData[i][entranceCustom] = cache_get_field_int(i, "entranceCustom");
EntranceData[i][entranceWorld] = cache_get_field_int(i, "entranceWorld");
if (EntranceData[i][entranceType] == 3)
CreateForklifts(i);
Entrance_Refresh(i);
}
return 1;
}
stock LoadEntrances()
{
mysql_function_query(sqlHandle, "SELECT `entranceID`,`entranceName`,`entranceIcon1`,`entrancePosX`,`entrancePosY`,`entrancePosZ`,`entrancePosA`,`entranceIntX`,`entranceIntY`,`entranceIntZ`,`entranceIntA`,`entranceInterior`,`entranceExterior`,`entranceExteriorVW`,`entranceType`,`entrancePass`,`entranceLocked`,`entranceCustom`,`entranceWorld` FROM ` entrances`", true, "Entrance_Load","");
}
cache_get_field_int
cache_get_field_content_int
mysql_function_query(sqlHandle, "SELECT `entranceID`,`entranceName`,`entranceIcon1`,`entrancePosX`,`entrancePosY`,`entrancePosZ`,`entrancePosA`,`entranceIntX`,`entranceIntY`,`entranceIntZ`,`entranceIntA`,`entranceInterior`,`entranceExterior`,`entranceExteriorVW`,`entranceType`,`entrancePass`,`entranceLocked`,`entranceCustom`,`entranceWorld` FROM ` entrances`", true, "Entrance_Load","");
mysql_tquery(sqlHandle, "SELECT `entranceID`,`entranceName`,`entranceIcon1`,`entrancePosX`,`entrancePosY`,`entrancePosZ`,`entrancePosA`,`entranceIntX`,`entranceIntY`,`entranceIntZ`,`entranceIntA`,`entranceInterior`,`entranceExterior`,`entranceExteriorVW`,`entranceType`,`entrancePass`,`entranceLocked`,`entranceCustom`,`entranceWorld` FROM ` entrances`", "Entrance_Load");
|
Change this :
Код:
cache_get_field_int Код:
cache_get_field_content_int Код:
mysql_function_query(sqlHandle, "SELECT `entranceID`,`entranceName`,`entranceIcon1`,`entrancePosX`,`entrancePosY`,`entrancePosZ`,`entrancePosA`,`entranceIntX`,`entranceIntY`,`entranceIntZ`,`entranceIntA`,`entranceInterior`,`entranceExterior`,`entranceExteriorVW`,`entranceType`,`entrancePass`,`entranceLocked`,`entranceCustom`,`entranceWorld` FROM ` entrances`", true, "Entrance_Load",""); Код:
mysql_tquery(sqlHandle, "SELECT `entranceID`,`entranceName`,`entranceIcon1`,`entrancePosX`,`entrancePosY`,`entrancePosZ`,`entrancePosA`,`entranceIntX`,`entranceIntY`,`entranceIntZ`,`entranceIntA`,`entranceInterior`,`entranceExterior`,`entranceExteriorVW`,`entranceType`,`entrancePass`,`entranceLocked`,`entranceCustom`,`entranceWorld` FROM ` entrances`", "Entrance_Load"); |
mysql_function_query(sqlHandle, "SELECT * FROM `entrances`", true, "Entrance_Load","");
cache_get_field_float
cache_get_field_content_float
|
Remove the space from ` entrances` there is a space in ` ` , it should be not there.
And if you are selecting almost all fields then use * So use this - Код:
mysql_function_query(sqlHandle, "SELECT * FROM `entrances`", true, "Entrance_Load",""); |
[20:14:03] [ERROR] CMySQLQuery::Execute[Gate_Load()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`' at line 1 [20:14:03] [ERROR] CMySQLQuery::Execute[Entrance_Load()] - (error #1054) Unknown column 'id' in 'field list' [20:17:02] [ERROR] CMySQLQuery::Execute[Gate_Load()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`' at line 1 [20:17:02] [ERROR] CMySQLQuery::Execute[Entrance_Load()] - (error #1054) Unknown column 'id' in 'field list' [20:22:33] [ERROR] cache_get_row_int - invalid datatype [20:22:33] [ERROR] cache_get_row_int - invalid datatype [20:22:33] [ERROR] cache_get_row_int - invalid datatype [20:22:33] [ERROR] cache_get_row_int - invalid datatype [20:22:33] [ERROR] cache_get_row_int - invalid datatype [20:22:33] [ERROR] cache_get_row_int - invalid datatype [20:23:56] [ERROR] cache_get_row_int - invalid datatype [20:23:56] [ERROR] cache_get_row_int - invalid datatype [20:23:56] [ERROR] cache_get_row_int - invalid datatype [20:23:56] [ERROR] cache_get_row_int - invalid datatype [20:23:56] [ERROR] cache_get_row_int - invalid datatype [20:23:56] [ERROR] cache_get_row_int - invalid datatype