]> jfr.im git - irc/gameservirc.git/blob - gameserv/php/readitems.php
finalizing the php scripts
[irc/gameservirc.git] / gameserv / php / readitems.php
1 <?php
2 $include ('mysql.php');
3 // type~ID~name~price~uses~strengthmod~defensemod~maxhpmod~hpmod~forestfightsmod~playerfightsmod~goldmod~bankbalmod
4
5 $handle = @fopen("$itemdata", "r");
6 if ($handle) {
7 while (!feof($handle)) {
8 $buffer = fgets($handle, 4096);
9 $item = explode(" ", $buffer, 13);
10 $id = $item[1];
11 $name = $item[2];
12 $price = $item[3];
13 $uses = $item[4];
14 $strengthmod = $item[5];
15 $defensemod = $item[6];
16 $maxhpmod = $item[7];
17 $hpmod = $item[8];
18 $forestfightsmod = $item[9];
19 $playerfightsmod = $item[10];
20 $goldmod = $item[11];
21 $bankbalmod = $item[12];
22 $query = "insert into $itemtablename values ('$id', '$name', '$price', '$uses', '$strengthmod', '$defensemod', '$maxhpmod', '$hpmod', '$forestfightsmod', '$playerfightsmod', '$goldmod', '$bankbalmod')";
23 mysql_query($query);
24 }
25 mysql_close($link);
26 fclose($handle);
27 }
28 ?>