07.05.2016, 03:01
So I am working on normalizing my database for my gamemode and I have ran into an issue with variables, I can't figure out a way where I can assign two different results into two different variables when looking for a value.
Here is the SELECT code
This is the tricky part for me, I don't know if I will get the same rowid if I use for the two different variables.
When using SQLite Browser I get the results that I want from two different row IDs I just don't know how to separate the two into different variables.
Variables
Example of what I am trying to accomplish
Thanks in advance :3
Here is the SELECT code
Код:
format(Query, sizeof(Query), "SELECT * FROM `Users`, `Weapons` WHERE Users.UserID = Weapons.ID", DB_Escape(pData[playerid][pID]));
Код:
db_get_field_assoc(Result, "Weapon", Query, 3); db_get_field_assoc(Result, "Ammo", Query, 5);
Variables
Код:
pData[playerid][pGunI] pData[playerid][pGunII] pData[playerid][pAmmoI] pData[playerid][pAmmoII]
Код:
Row 1 = 2 //Same ID as Row 2 Row 2 = 24 //Same ID as Row 1 pData[playerid][pGunI] = 2 //Row one for the same player pData[playerid][pGunII] = 24 //Row two for the same player