mysql question
#1

Mysql plugin from Blue is different from the php one (normal). Save system is same but I cant figure out how does load system works.
PHP код:
PlayerInfo[playerid][pScore] = cache_get_field_content_int(0"Score"connection
This is the code and I cant figure out where does that 0 comes from and will this work only for player id 0 ingame?
Reply
#2

The first parameter is the rowid. It is 0 because there is only 1 row in the table with the player's name.

If for example you have selected all the data from a table without a WHERE clause in the query, you'd have to use a loop and use the variable for the rowid:
pawn Код:
for (new i, j = cache_get_row_count(); i != j; i++)
{
    ... = cache_get_field_content_int(i, "...");
}
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
The first parameter is the rowid. It is 0 because there is only 1 row in the table with the player's name.

If for example you have selected all the data from a table without a WHERE clause in the query, you'd have to use a loop and use the variable for the rowid:
pawn Код:
for (new i, j = cache_get_row_count(); i != j; i++)
{
    ... = cache_get_field_content_int(i, "...");
}
Oh thanks That would be useful for other systems
Reply
#4

Quote:
Originally Posted by ilijap
Посмотреть сообщение
Mysql plugin from Blue is different from the php one (normal).
What the heck do you mean with that lol. Obviously the code is different, but the SQL syntax stays the same.
Reply
#5

Quote:
Originally Posted by JasperM
Посмотреть сообщение
What the heck do you mean with that lol. Obviously the code is different, but the SQL syntax stays the same.
IK that SQL Syntax is same but some functions are different
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)