Quote:
Originally Posted by ******
Again, why are you storing multiple values in a single column? That's really not how you should be using a database. Make a new table for the object IDs and store one per row.
|
Sorry, my bad. I didn't understand the question.
I already have a table with all objects and x,y,z:
https://imgur.com/a/jmB80p3
So, above is a pictures with all the objects and x,y,z. When a new player register, he got some random objectID from this table, and all the id that player get, i'm saving in a different table.
And i'm using something like that to save the id in database.
Код:
public saveQuest(playerid) {
generateIdRandomFromDb(playerid);
new string[256];
string[0] = (EOS);
for(new x; x < 50; x++) {
format(string, sizeof string, "%s %d", questInfo[playerid][databaseID_object][x]);
}
mysql_format(db, string, sizeof string, "UPDATE `special_table` SET `objectID` = '%e' WHERE `playerID` = %d LIMIT 1;", string, pID[playerid]);
mysql_tquery(db, string);
}
This is the most easier way to do for myself and for the system. Better ways aren't (I think).
And simply, when a player connect, i've loaded his id of an object from database:
Код:
// public LoadQuest (playerid) {
mysql_format(db, Gstring, "SELECt blablabla.... WHERE id .. bla blabla
mysql_tquery(db, Gstrin, bla bla bla..
}
//another public
public finishLoad(playerid) {
if(!cache_num_rows()) return 1;
new show_s[300], var_storage[50];
cache_get_field_content(0, "ObjectID", show_s);
sscanf(show_s, "a<i>[50]", var_storage);
for(new x; x < 50; x++) {
questInfo[playerid][databaseID_object][x] = var_storage[x];
}
}
So every think work perfectly, but i don't know how to store in php the objectID in a array like
$var_storage[x]
to make a loop and create red marker on the San Andreas map.