MySQL Query loads data incorrectly -
ZBits - 11.08.2015
Hello!,
So i am trying to retrieve data from my MySQL table and it seems to be retrieving data twice.
pawn Код:
for(new i, k = cache_get_row_count(Connection); i < k; i++)
{
Weapon_ID = cache_get_row_int(i, 0, Connection);
Ammo = cache_get_row_int(i, 1, Connection);
printf("Ammo: %d",Ammo);
}
There is only 1 row of data and the Ammo amount is 100. However upon login it gives 200. It keepts doubling the ammo value. I tried debugging and this was the result.
Help would be appreciated!
Re: MySQL Query loads data incorrectly -
ZBits - 12.08.2015
I'd like to give this a bump.
Re: MySQL Query loads data incorrectly -
SickAttack - 12.08.2015
Did you try the below?
Re: MySQL Query loads data incorrectly -
ZBits - 12.08.2015
Quote:
Originally Posted by SickAttack
|
I did try that, gave the same result.
Debug Log:
Код:
[20:30:57] Ammo: 100
[20:30:57] Ammo: 0
[20:30:57] Ammo: 100
[20:30:57] Ammo: 0
EDIT: its also loading the weapon the same way
Код:
Weapon_ID: 24 | Ammo: 100
Weapon_ID: 0 | Ammo: 0
Weapon_ID: 24 | Ammo: 100
Weapon_ID: 0 | Ammo: 0
Re: MySQL Query loads data incorrectly -
SickAttack - 12.08.2015
How many rows does it return and how many rows do you have?
Re: MySQL Query loads data incorrectly -
ZBits - 12.08.2015
I got 1 row. And it seems to be returning 4 rows with
and 2 rows with
Re: MySQL Query loads data incorrectly -
SickAttack - 12.08.2015
But what does "cache_get_row_count(Connection)" possess?
Anyway, if you get two, then "for(new i = 1;...".
Re: MySQL Query loads data incorrectly -
ZBits - 12.08.2015
cache_get_row_count prints out
that is really werid.
Re: MySQL Query loads data incorrectly -
SickAttack - 12.08.2015
Nice, let's validate the name as a value.
Re: MySQL Query loads data incorrectly -
ZBits - 12.08.2015
Quote:
Originally Posted by SickAttack
Nice, let's validate the name as a value. 
|
what?