Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   Mass adding to SQL (https://postpacific.loc-online.com/showthread.php?t=6486)

kin 24.12.2006 13:42

Mass adding to SQL
 
Is there any way to add some item to all players at ones? Not one by one.

TuMBLer 24.12.2006 13:47

see chrono_darbuka sql sript in db_scripts

FidoW 24.12.2006 13:47

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.

kin 24.12.2006 13:50

Gents, I do not have that script. Could you please give me the link if possible.

nish 24.12.2006 15:47

lol they came in the PP pack everyone who has the files has them

kin 24.12.2006 15:51

Newer used PP pack :)
All links are died already.

m4rk 24.12.2006 19:12

maybe try in irc

kin 28.12.2006 13:13

Still can't get it. Need your help gents!

m4rk 28.12.2006 14:12

http://www.thugz-board.com/PP-IRC-C4Retail.7z
next time search in google T_T

Gaikotsu 29.12.2006 11:42

in PHP:
Code:

<?
$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";
 }
?>


kin 29.12.2006 12:42

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.


All times are GMT. The time now is 15:26.