I suggest to you to do this via NPC Script PLUS SQL Query, since in MySQL the loop's condition (while, for) is not so easy.
Well I'm not an expert in SQL and I strongly suggest to do this on a secondary db. Here is the logic: In Inventory you have each rows a unique player item. So to do that you must run a query that goes to the first "char_id" to the last one, creating each row for each player. So if you have 50 players, the loop will run 50 times.
for(set @i, 150000, set @j, 3; @i <= 150060; set @i, @i + 1, set @j, @j + 1){
query_sql " INSERT INTO `inventory`(`id`, `char_id`, `nameid`,
`amount`, `equip`, `identify`, `refine`, `attribute`, `card0`, `card1`,
`card2`, `card3`, `expire_time`, `favorite`, `bound`, `unique_id`)
VALUES ("+@j+","+@i+",ITEM ID,AMOUNT,0,0,0,0,0,0,0,0,0,0,0,0)";
}
Mine for example:
If I had 5 players, will start at 150000 and end at 150005. And I need to respect the ID order.
Hope you get it, I dont know if this is correct