properties.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <?php
  2. $properties = [
  3. "useractivity" => 26812157,
  4. "logins" => 4361,
  5. "weaponsbought" => 11148,
  6. "attackmisses" => 23099,
  7. "attackdamage" => 59339207,
  8. "attackhits" => 52822,
  9. "axehits" => 1067,
  10. "attackswon" => 14058,
  11. "highestbeaten" => 100,
  12. "bestkillstreak" => 504,
  13. "jailed" => 306,
  14. "mailssent" => 1724,
  15. "attackcriticalhits" => 10813,
  16. "slahits" => 425,
  17. "moneymugged" => 19552798251,
  18. "largestmug" => 1000026663,
  19. "friendmailssent" => 375,
  20. "roundsfired" => 271152,
  21. "pishits" => 346,
  22. "defendswon" => 2765,
  23. "hospital" => 8372,
  24. "defendslost" => 3694,
  25. "rifhits" => 6620,
  26. "attackslost" => 797,
  27. "attacksassisted" => 336,
  28. "attacksstealthed" => 8335,
  29. "onehitkills" => 6547,
  30. "dumpsearches" => 1026,
  31. "dumpfinds" => 1026,
  32. "itemsdumped" => 5050,
  33. "itemssent" => 3567,
  34. "drugsused" => 5351,
  35. "cantaken" => 77,
  36. "auctionswon" => 16,
  37. "daysbeendonator" => 1880,
  38. "spousemailssent" => 104,
  39. "medicalitemsused" => 21704,
  40. "companymailssent" => 185,
  41. "trainsreceived" => 1071,
  42. "cityfinds" => 522,
  43. "theyrunaway" => 1022,
  44. "failedbusts" => 249,
  45. "peoplebusted" => 3000,
  46. "pointsbought" => 44095,
  47. "itemsbought" => 3426,
  48. "xantaken" => 4811,
  49. "traveltimes" => 3474,
  50. "mextravel" => 481,
  51. "itemsboughtabroad" => 92725,
  52. "cantravel" => 462,
  53. "lontravel" => 387,
  54. "caytravel" => 410,
  55. "argtravel" => 350,
  56. "hawtravel" => 165,
  57. "japtravel" => 132,
  58. "switravel" => 586,
  59. "soutravel" => 133,
  60. "dubtravel" => 172,
  61. "chitravel" => 196,
  62. "shrtaken" => 50,
  63. "shohits" => 157,
  64. "piehits" => 4646,
  65. "bountiescollected" => 798,
  66. "totalbountyreward" => 210769630,
  67. "medstolen" => 8,
  68. "attacksdraw" => 218,
  69. "virusescoded" => 125,
  70. "yourunaway" => 157,
  71. "victaken" => 84,
  72. "overdosed" => 108,
  73. "revivesreceived" => 805,
  74. "auctionsells" => 15,
  75. "exttaken" => 246,
  76. "kettaken" => 50,
  77. "respectforfaction" => 76338,
  78. "smghits" => 1663,
  79. "bountiesreceived" => 206,
  80. "factionmailssent" => 173,
  81. "peoplebought" => 502,
  82. "peopleboughtspent" => 54974080,
  83. "chahits" => 234,
  84. "machits" => 119,
  85. "heahits" => 697,
  86. "networth" => 30913343466,
  87. "grehits" => 276,
  88. "missioncreditsearned" => 40942,
  89. "contractscompleted" => 1022,
  90. "dukecontractscompleted" => 1022,
  91. "revives" => 663,
  92. "missionscompleted" => 1,
  93. "bountiesplaced" => 486,
  94. "totalbountyspent" => 194793585,
  95. "bloodwithdrawn" => 5140,
  96. "lsdtaken" => 11,
  97. "defendsstalemated" => 28,
  98. "meritsbought" => 45,
  99. "opitaken" => 14,
  100. "nerverefills" => 1409,
  101. "consumablesused" => 24693,
  102. "candyused" => 1838,
  103. "alcoholused" => 13823,
  104. "energydrinkused" => 9032,
  105. "tokenrefills" => 200,
  106. "organisedcrimes" => 158,
  107. "booksread" => 10,
  108. "h2hhits" => 147,
  109. "classifiedadsplaced" => 6,
  110. "traveltime" => 37995600,
  111. "unarmoredwon" => 259,
  112. "stockpayouts" => 486,
  113. "boostersused" => 1188,
  114. "territorytime" => 2624733,
  115. "rehabs" => 6667,
  116. "rehabcost" => 1404830000,
  117. "awards" => 462,
  118. "statenhancersused" => 5,
  119. "bestdamage" => 11472,
  120. "racingpointsearned" => 2118,
  121. "raceswon" => 698,
  122. "racesentered" => 2390,
  123. "receivedbountyvalue" => 88109384,
  124. "pcptaken" => 1,
  125. "cityitemsbought" => 85276,
  126. "specialammoused" => 10977,
  127. "spetaken" => 1,
  128. "hollowammoused" => 4000,
  129. "tracerammoused" => 2498,
  130. "incendiaryammoused" => 2493,
  131. "piercingammoused" => 1986,
  132. "refills" => 1611
  133. ];
  134. $list = [];
  135. foreach ( $properties as $key => $val ) {
  136. $list[] = strval($key);
  137. }
  138. print("<pre>");
  139. print_r( $list );
  140. print("</pre>");
  141. $pdo = null;
  142. try {
  143. $pdo = new PDO("sqlite:" . './slork.sqlite');
  144. } catch (PDOException $e) {
  145. // handle the exception here
  146. }
  147. if ( !$pdo ) {
  148. exit( "Cannot connect to database" );
  149. }
  150. $query = "DROP TABLE IF EXISTS properties;";
  151. $pdo->exec( $query );
  152. $query = "CREATE TABLE IF NOT EXISTS properties (id INTEGER PRIMARY KEY, property TEXT, UNIQUE(property));";
  153. $pdo->exec( $query );
  154. $query = "INSERT INTO properties (property) VALUES (?) ON CONFLICT (property) DO NOTHING;";
  155. $stmt = $pdo->prepare( $query );
  156. foreach ( $list as $item ) {
  157. $stmt->execute( [$item] );
  158. }
  159. /**
  160. $query = "SELECT property FROM properties;";
  161. $stmt = $pdo->query( $query );
  162. foreach( $stmt as $row ) {
  163. print( $row['property'] . ', ');
  164. }
  165. */