Ich weiss net wei ich weiter machen soll bei demm Tankstellen Bizz system (MYSQL).
bitte um hilfe
ich habe bis jetzt:
#define MAX_TankStellen 60
enum TankDaten
{
Inhaber,
CoInhaber,
Preis,
TankPreis,
kauflevel,
Float:TankposX,
Float:TankposY,
Float:TankposZ,
Text3D:Label
}
new TankInfo[MAX_TankStellen][TankDaten];
stock mysql_CreateBiz(Float:x,Float:y,Float:z,besitzer[64],preis,level)
{
new query[256];
mysql_real_escape_string(buname, buname);
format(query, sizeof(query), "INSERT INTO business (BizzID,Name) VALUES ('%d','%s')", buid,buname);
mysql_query(query);
return true;
}
stock mysql_CheckBiz()
{
new Query[128];
new id[20];
mysql_real_escape_string(id, id);
format(Query, sizeof(Query), "SELECT * FROM biz WHERE BizzID = '%d'", id);
mysql_query(Query);
mysql_store_result();
return mysql_num_rows();
}
// =========== GET ===================
stock mysql_GetFloatBiz(Table[], Field[], Where[], Is[])
{
new query[128], Float:sqlfloat;
mysql_real_escape_string(Table, Table);
mysql_real_escape_string(Field, Field);
mysql_real_escape_string(Where, Where);
mysql_real_escape_string(Is, Is);
format(query, 128, "SELECT %s FROM %s WHERE %s = '%s'", Field, Table, Where, Is);
mysql_query(query);
mysql_store_result();
mysql_fetch_float(sqlfloat);
mysql_free_result();
return sqlfloat;
}
stock mysql_GetIntBiz(Table[], Field[], Where[], Is[])
{
new query[128];
mysql_real_escape_string(Table, Table);
mysql_real_escape_string(Field, Field);
mysql_real_escape_string(Where, Where);
mysql_real_escape_string(Is, Is);
format(query, 128, "SELECT %s FROM %s WHERE %s = '%s'", Field, Table, Where, Is);
mysql_query(query);
mysql_store_result();
new sqlint = mysql_fetch_int();
mysql_free_result();
return sqlint;
}
// ==================== SET================================
stock mysql_SetFloatBiz(Table[], Field[], Float:To, Where[], Where2[])
{
new query[128];
mysql_real_escape_string(Table, Table);
mysql_real_escape_string(Field, Field);
mysql_real_escape_string(Where, Where);
mysql_real_escape_string(Where2, Where2);
format(query, 128, "UPDATE %s SET %s = '%.1f' WHERE %s = '%s'", Table, Field, To, Where, Where2);
mysql_query(query);
return true;
}
stock mysql_SetIntBiz(Table[], Field[], To, Where[], Where2[])
{
new query[128];
mysql_real_escape_string(Table, Table);
mysql_real_escape_string(Field, Field);
mysql_real_escape_string(Where, Where);
mysql_real_escape_string(Where2, Where2);
format(query, 128, "UPDATE %s SET %s = '%d' WHERE %s = '%s'", Table, Field, To, Where, Where2);
mysql_query(query);
return true;
}