You would need a table like this:
- listname VARCHAR(10) NOT NULL (change 10 to however long you may need the name)
- listdata INT(11) NOT NULL (assumed an int based on the global variable)
- authid VARCHAR(35) NOT NULL
- PRIMARY KEY(listname, authid)
Then you can do this:
Code:
new szAuthID[ 35 ];
get_user_authid( iPlayer, szAuthID, charsmax( szAuthID ) );
new Handle:hQuery;
for( new i; i < ilist; i++ )
{
hQuery = SQL_PrepareQuery( /* connection */,\
"INSERT INTO table \
(listname, listdata, authid) \
VALUES \
(^"%s^", %d, ^"%s^") \
ON DUPLICATE KEY UPDATE \
listdata = %d;",\
gListname[ i ], gPlayerListData[ iPlayer ][ i ], szAuthID, gPlayerListData[ iPlayer ][ i ] );
// execute query
}
__________________