View Full Version : Mass adding to SQL
Is there any way to add some item to all players at ones? Not one by one.
see chrono_darbuka sql sript in db_scripts
yes.... for example... look at the SQL scripts to convert C1 DB to C4... there are a script that create the Chrono Cithara.. Unitus etc... the script basicly create a temporary table and select the most level player of each account and insert items into warehouse.
Gents, I do not have that script. Could you please give me the link if possible.
lol they came in the PP pack everyone who has the files has them
Newer used PP pack :)
All links are died already.
Still can't get it. Need your help gents!
http://www.thugz-board.com/PP-IRC-C4Retail.7z
next time search in google T_T
Gaikotsu
29.12.2006, 11:42
in PHP:
<?
$mssql_server = "127.0.0.1";
$mssql_user = "";
$mssql_pass = "";
$add_item_id = 3434; // item id
$add_item_count = 5; // item count
set_time_limit(0);
mssql_connect($mssql_server, $mssql_user, $mssql_pass);
mssql_select_db("lin2world");
$result = mssql_query("SELECT char_id FROM user_data WHERE char_id > 0");
$chars=array();
for($x=0; $chars[$x]=mssql_fetch_assoc($result); $x++);
unset($chars[count($chars)-1]);
for ($x=0; $x<count($chars); $x++)
{
$fields = "char_id, item_type, amount, enchant, eroded, bless, ident, wished, warehouse";
$values = $chars[$x][char_id].", ".$add_item_id.", ".$add_item_count.", 0, 0, 0, 0, 0, 0";
$result = mssql_query("INSERT INTO user_item($fields) VALUES($values)");
if (!$result)
echo "Item $add_item_id not added to ".$chars[$x][char_id]."\n";
}
?>
Thanks Gaikotsu! Will try it.
m4rk
I can use search and of course I found it. The problem was I couldn't find the script for Chrono Darbuka inside the pack.