31.10.2016, 12:44
No, it still has issues:
- You still left it as 'Name' and explained what will return if trying to retrieve the text.
- db_result is unknown.
- do .. while loop, you forgot "do".
- The second parameter in db_get_field_assoc is a string so you'd use "Name" and not 'Name'.
- Formatting another string is again pointless.
- You still left it as 'Name' and explained what will return if trying to retrieve the text.
- db_result is unknown.
- do .. while loop, you forgot "do".
- The second parameter in db_get_field_assoc is a string so you'd use "Name" and not 'Name'.
- Formatting another string is again pointless.
Код:
CMD:factions(playerid, params[])
{
new DBResult: Result = db_query(Database, "SELECT `Name` FROM `Faction");
if (db_num_rows(Result))
{
new Field[30];
do
{
db_get_field_assoc(Result, "Name", Field, 30);
// or
// db_get_field(Result, 0, Field, 30);
SCM(playerid, COLOR_YELLOW, Field);
}
while (db_next_row(Result));
}
db_free_result(Result);
return 1;
}

