Why this won't work?
#7

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.

Код:
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;
}
Reply


Messages In This Thread
Why this won't work? - by StrikerZ - 31.10.2016, 11:11
Re: Why this won't work? - by Konstantinos - 31.10.2016, 12:27
Re: Why this won't work? - by StrikerZ - 31.10.2016, 12:35
Re: Why this won't work? - by Logic_ - 31.10.2016, 12:36
Re: Why this won't work? - by StrikerZ - 31.10.2016, 12:39
Re: Why this won't work? - by Logic_ - 31.10.2016, 12:43
Re: Why this won't work? - by Konstantinos - 31.10.2016, 12:44
Re: Why this won't work? - by StrikerZ - 31.10.2016, 12:45
Re: Why this won't work? - by SyS - 31.10.2016, 12:48
Re: Why this won't work? - by StrikerZ - 31.10.2016, 12:50

Forum Jump:


Users browsing this thread: 1 Guest(s)