MySQL column question.
#1

I there anyway to make 1 column with 5 ints? like 0 | 0 | 0 | 0 | 0 |

I've seen a gamemode before with this...
instead of making 5 column, and how can I load them into integers using BlueG plugin
Reply
#2

Using sscanf.
Reply
#3

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
Using sscanf.
Like he said, in example:

pawn Код:
forward LoadData(playerid, intid);
public LoadData(playerid, intid)
{
    new query[70], Data[70], int1, int2, int3, int4;
    format(query, sizeof(query), "SELECT int1, int2, int3, int4 FROM int_table WHERE intid = '%d'", intid);
    mysql_query(query);
    mysql_store_result();
    mysql_fetch_row_format(Data, "|");
    if(sscanf(Data, "p<|>iiii", int1, int2, int3, int4)) return print("Error loading the integers");
    mysql_free_result();
    return 1;
}
Reply
#4

What exactly are you trying to do? Putting multiple values in a single field is almost never a good idea, except if you are working with bitflags.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)