12.10.2010, 13:17
The problem is that... i am looping through numbers that are not needed...this is basicly what my script looks like: (Not exact...)
So, as you can see... if my IDs in my table look like:
ID - Model - X - Y -Z
2 - 411 - x - y -z
5 - 560 - x - y -z
Then it will store null values when it looks through 1,3 and 4... SEe what i mean??
But when i INSERT INTO table (field, field, field) VALUES (field, field, field) the ID is Auto incremented so it then adds the next record as ID 6..
So, this will mean... even tho at the moment there is 2 records.. i need 5 loops so i get to ID 5 and therefore orgVehs need to be 5..
I hope you can see my problem :S
(If i get up to ID 100 and i only am using 10 of them...thats 90 queries/loops that do nothing )
pawn Код:
#define orgVehs 25 // Or whatever the highest "ID" is in my table.
public loadOrgVehs(){
for(new i=0; i<orgVehs; i++){
format(string, sizeof(string), "SELECT * FROM table WHERE ID='%d' ", i);
mysql_query(string);
//THEN STORE DATA AND PUT INTO MY ENUM (orgVehs[orgvehID][vModel/vOrgID/vX/vY etc...]
}
return 1;
}
ID - Model - X - Y -Z
2 - 411 - x - y -z
5 - 560 - x - y -z
Then it will store null values when it looks through 1,3 and 4... SEe what i mean??
But when i INSERT INTO table (field, field, field) VALUES (field, field, field) the ID is Auto incremented so it then adds the next record as ID 6..
So, this will mean... even tho at the moment there is 2 records.. i need 5 loops so i get to ID 5 and therefore orgVehs need to be 5..
I hope you can see my problem :S
(If i get up to ID 100 and i only am using 10 of them...thats 90 queries/loops that do nothing )