Advertisement
OldManRiver

Fix_DB.php

Sep 5th, 2015
423
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /***************************************************************************/
  3. include_once("inc/config.php");
  4. include_once("inc/session.php");
  5. include_once("inc/functions.php");
  6.  
  7. $db = mysql_connect($db_host, $db_user, $db_pass);
  8. mysql_select_db($db_db, $db);
  9. $fix_sch = "SELECT `score_scha`, `score_schb` FROM `sb_temp` ORDER BY `score_scha`, `score_schb`;";
  10. $fix_res = mysql_query($fix_sch);
  11. $row_ray = array();
  12. $val_cnt = 0;
  13. while ($row = mysql_fetch_array($fix_res, MYSQL_NUM)) {
  14. $vlen = strlen ( trim ( $row[1] ) );
  15. // $ival = bin2hex ( trim ( $row[1] ) );
  16. $ival = substr ( trim ( $row[1] ),0, $vlen );
  17. echo "I=> $ival <br>\n";
  18. if ( is_string ( $ival ) ) {
  19. $val_cnt++;
  20. array_push($row_ray, "$val_cnt", "$ival");
  21. } // end if is_string ( $ival )
  22. } // end while
  23. array_unique ( sort ( $row_ray ) );
  24. foreach ( $row_ray as $key => $val ) {
  25. // $rval = trim ( substr ( $val,4 ) );
  26. // if ( is_numeric ( $rval ) ) { continue; }
  27. echo "K=> $key V=> $val <br>\n";
  28. } // end foreach
  29.  
  30.  
  31.  
  32. ?>
  33. This is not trapping and eliminating the numeric values.
  34.  
  35. Results:
  36.  
  37. K=> 0 V=> row=1 <br>
  38. K=> 1 V=> row=10 <br>
  39. K=> 2 V=> row=100 <br>
  40. K=> 3 V=> row=101 <br>
  41. K=> 4 V=> row=102 <br>
  42. K=> 5 V=> row=103 <br>
  43. K=> 6 V=> row=104 <br>
  44. K=> 7 V=> row=105 <br>
  45. K=> 8 V=> row=106 <br>
  46. K=> 9 V=> row=107 <br>
  47. K=> 10 V=> row=108 <br>
  48. K=> 11 V=> row=109 <br>
  49. K=> 12 V=> row=11 <br>
  50. K=> 13 V=> row=110 <br>
  51. K=> 14 V=> row=111 <br>
  52. K=> 15 V=> row=112 <br>
  53. K=> 16 V=> row=113 <br>
  54. K=> 17 V=> row=114 <br>
  55. K=> 18 V=> row=115 <br>
  56. K=> 19 V=> row=116 <br>
  57. K=> 20 V=> row=117 <br>
  58. K=> 21 V=> row=118 <br>
  59. K=> 22 V=> row=119 <br>
  60. K=> 23 V=> row=12 <br>
  61. K=> 24 V=> row=120 <br>
  62. K=> 25 V=> row=121 <br>
  63. K=> 26 V=> row=122 <br>
  64. K=> 27 V=> row=123 <br>
  65. K=> 28 V=> row=124 <br>
  66. K=> 29 V=> row=125 <br>
  67. K=> 30 V=> row=126 <br>
  68. K=> 31 V=> row=127 <br>
  69. K=> 32 V=> row=128 <br>
  70. K=> 33 V=> row=129 <br>
  71. K=> 34 V=> row=13 <br>
  72. K=> 35 V=> row=130 <br>
  73. K=> 36 V=> row=131 <br>
  74. K=> 37 V=> row=132 <br>
  75. K=> 38 V=> row=133 <br>
  76. K=> 39 V=> row=134 <br>
  77. K=> 40 V=> row=135 <br>
  78. K=> 41 V=> row=136 <br>
  79. K=> 42 V=> row=137 <br>
  80. K=> 43 V=> row=138 <br>
  81. K=> 44 V=> row=139 <br>
  82. K=> 45 V=> row=14 <br>
  83. K=> 46 V=> row=140 <br>
  84. K=> 47 V=> row=141 <br>
  85. K=> 48 V=> row=142 <br>
  86. K=> 49 V=> row=143 <br>
  87. K=> 50 V=> row=144 <br>
  88. K=> 51 V=> row=145 <br>
  89. K=> 52 V=> row=146 <br>
  90. K=> 53 V=> row=147 <br>
  91. K=> 54 V=> row=148 <br>
  92. K=> 55 V=> row=149 <br>
  93. K=> 56 V=> row=15 <br>
  94. K=> 57 V=> row=150 <br>
  95. K=> 58 V=> row=151 <br>
  96. K=> 59 V=> row=152 <br>
  97. K=> 60 V=> row=153 <br>
  98. K=> 61 V=> row=154 <br>
  99. K=> 62 V=> row=155 <br>
  100. K=> 63 V=> row=156 <br>
  101. K=> 64 V=> row=157 <br>
  102. K=> 65 V=> row=158 <br>
  103. K=> 66 V=> row=159 <br>
  104. K=> 67 V=> row=16 <br>
  105. K=> 68 V=> row=160 <br>
  106. K=> 69 V=> row=161 <br>
  107. K=> 70 V=> row=162 <br>
  108. K=> 71 V=> row=163 <br>
  109. K=> 72 V=> row=164 <br>
  110. K=> 73 V=> row=165 <br>
  111. K=> 74 V=> row=166 <br>
  112. K=> 75 V=> row=167 <br>
  113. K=> 76 V=> row=168 <br>
  114. K=> 77 V=> row=169 <br>
  115. K=> 78 V=> row=17 <br>
  116. K=> 79 V=> row=18 <br>
  117. K=> 80 V=> row=19 <br>
  118. K=> 81 V=> row=2 <br>
  119. K=> 82 V=> row=20 <br>
  120. K=> 83 V=> row=21 <br>
  121. K=> 84 V=> row=22 <br>
  122. K=> 85 V=> row=23 <br>
  123. K=> 86 V=> row=24 <br>
  124. K=> 87 V=> row=25 <br>
  125. K=> 88 V=> row=26 <br>
  126. K=> 89 V=> row=27 <br>
  127. K=> 90 V=> row=28 <br>
  128. K=> 91 V=> row=29 <br>
  129. K=> 92 V=> row=3 <br>
  130. K=> 93 V=> row=30 <br>
  131. K=> 94 V=> row=31 <br>
  132. K=> 95 V=> row=32 <br>
  133. K=> 96 V=> row=33 <br>
  134. K=> 97 V=> row=34 <br>
  135. K=> 98 V=> row=35 <br>
  136. K=> 99 V=> row=36 <br>
  137. K=> 100 V=> row=37 <br>
  138. K=> 101 V=> row=38 <br>
  139. K=> 102 V=> row=39 <br>
  140. K=> 103 V=> row=4 <br>
  141. K=> 104 V=> row=40 <br>
  142. K=> 105 V=> row=41 <br>
  143. K=> 106 V=> row=42 <br>
  144. K=> 107 V=> row=43 <br>
  145. K=> 108 V=> row=44 <br>
  146. K=> 109 V=> row=45 <br>
  147. K=> 110 V=> row=46 <br>
  148. K=> 111 V=> row=47 <br>
  149. K=> 112 V=> row=48 <br>
  150. K=> 113 V=> row=49 <br>
  151. K=> 114 V=> row=5 <br>
  152. K=> 115 V=> row=50 <br>
  153. K=> 116 V=> row=51 <br>
  154. K=> 117 V=> row=52 <br>
  155. K=> 118 V=> row=53 <br>
  156. K=> 119 V=> row=54 <br>
  157. K=> 120 V=> row=55 <br>
  158. K=> 121 V=> row=56 <br>
  159. K=> 122 V=> row=57 <br>
  160. K=> 123 V=> row=58 <br>
  161. K=> 124 V=> row=59 <br>
  162. K=> 125 V=> row=6 <br>
  163. K=> 126 V=> row=60 <br>
  164. K=> 127 V=> row=61 <br>
  165. K=> 128 V=> row=62 <br>
  166. K=> 129 V=> row=63 <br>
  167. K=> 130 V=> row=64 <br>
  168. K=> 131 V=> row=65 <br>
  169. K=> 132 V=> row=66 <br>
  170. K=> 133 V=> row=67 <br>
  171. K=> 134 V=> row=68 <br>
  172. K=> 135 V=> row=69 <br>
  173. K=> 136 V=> row=7 <br>
  174. K=> 137 V=> row=70 <br>
  175. K=> 138 V=> row=71 <br>
  176. K=> 139 V=> row=72 <br>
  177. K=> 140 V=> row=73 <br>
  178. K=> 141 V=> row=74 <br>
  179. K=> 142 V=> row=75 <br>
  180. K=> 143 V=> row=76 <br>
  181. K=> 144 V=> row=77 <br>
  182. K=> 145 V=> row=78 <br>
  183. K=> 146 V=> row=79 <br>
  184. K=> 147 V=> row=8 <br>
  185. K=> 148 V=> row=80 <br>
  186. K=> 149 V=> row=81 <br>
  187. K=> 150 V=> row=82 <br>
  188. K=> 151 V=> row=83 <br>
  189. K=> 152 V=> row=84 <br>
  190. K=> 153 V=> row=85 <br>
  191. K=> 154 V=> row=86 <br>
  192. K=> 155 V=> row=87 <br>
  193. K=> 156 V=> row=88 <br>
  194. K=> 157 V=> row=89 <br>
  195. K=> 158 V=> row=9 <br>
  196. K=> 159 V=> row=90 <br>
  197. K=> 160 V=> row=91 <br>
  198. K=> 161 V=> row=92 <br>
  199. K=> 162 V=> row=93 <br>
  200. K=> 163 V=> row=94 <br>
  201. K=> 164 V=> row=95 <br>
  202. K=> 165 V=> row=96 <br>
  203. K=> 166 V=> row=97 <br>
  204. K=> 167 V=> row=98 <br>
  205. K=> 168 V=> row=99 <br>
  206. K=> 169 V=> val= S & S CONS <br>
  207. K=> 170 V=> val=ALBA-GOLDEN <br>
  208. K=> 171 V=> val=ALL SAINTS EPISCOPAL <br>
  209. K=> 172 V=> val=ALL SAINTS EPISCOPAL <br>
  210. K=> 173 V=> val=ALTO <br>
  211. K=> 174 V=> val=ALTO <br>
  212. K=> 175 V=> val=ANNA <br>
  213. K=> 176 V=> val=ARGYLE <br>
  214. K=> 177 V=> val=ARKANSAS HIGH <br>
  215. K=> 178 V=> val=ARKANSAS HIGH <br>
  216. K=> 179 V=> val=ARKANSAS HIGH <br>
  217. K=> 180 V=> val=ATLANTA <br>
  218. K=> 181 V=> val=ATLANTA <br>
  219. K=> 182 V=> val=ATLANTA <br>
  220. K=> 183 V=> val=BECKVILLE <br>
  221. K=> 184 V=> val=BROOK HILL SCHOOL <br>
  222. K=> 185 V=> val=BROWNSBORO <br>
  223. K=> 186 V=> val=BROWNSBORO <br>
  224. K=> 187 V=> val=BULLARD <br>
  225. K=> 188 V=> val=CADDO MILLS <br>
  226. K=> 189 V=> val=CANTON <br>
  227. K=> 190 V=> val=CANTON <br>
  228. K=> 191 V=> val=CANTON <br>
  229. K=> 192 V=> val=CELINA <br>
  230. K=> 193 V=> val=CENTERVILLE <br>
  231. K=> 194 V=> val=CHAPEL HILL <br>
  232. K=> 195 V=> val=CHAPEL HILL <br>
  233. K=> 196 V=> val=CHINA SPRING <br>
  234. K=> 197 V=> val=CLARKSVILLE <br>
  235. K=> 198 V=> val=COMMERCE <br>
  236. K=> 199 V=> val=COMMERCE <br>
  237. K=> 200 V=> val=COMMUNITY <br>
  238. K=> 201 V=> val=CRANDALL <br>
  239. K=> 202 V=> val=CRANDALL <br>
  240. K=> 203 V=> val=CRANDALL <br>
  241. K=> 204 V=> val=CROCKETT <br>
  242. K=> 205 V=> val=DAINGERFIELD <br>
  243. K=> 206 V=> val=DANGERFIELD <br>
  244. K=> 207 V=> val=DANGERFIELD <br>
  245. K=> 208 V=> val=DAWSON <br>
  246. K=> 209 V=> val=DETROIT <br>
  247. K=> 210 V=> val=DIBOLL <br>
  248. K=> 211 V=> val=EDGEWOOD <br>
  249. K=> 212 V=> val=ELYSIAN FIELDS <br>
  250. K=> 213 V=> val=FARMERSVILLE <br>
  251. K=> 214 V=> val=FARMERSVILLE <br>
  252. K=> 215 V=> val=FLOUR BLUFF <br>
  253. K=> 216 V=> val=FORD <br>
  254. K=> 217 V=> val=FORD <br>
  255. K=> 218 V=> val=FORNEY <br>
  256. K=> 219 V=> val=FOSSIL RIDGE <br>
  257. K=> 220 V=> val=FRANKSTON <br>
  258. K=> 221 V=> val=GAINESVILLE <br>
  259. K=> 222 V=> val=GARRISON <br>
  260. K=> 223 V=> val=GILMER <br>
  261. K=> 224 V=> val=GILMER <br>
  262. K=> 225 V=> val=GILMER <br>
  263. K=> 226 V=> val=GLADEWATER <br>
  264. K=> 227 V=> val=GLADEWATER <br>
  265. K=> 228 V=> val=GRACE COMMUNITY <br>
  266. K=> 229 V=> val=GRAND SALINE <br>
  267. K=> 230 V=> val=GRAND SALINE <br>
  268. K=> 231 V=> val=GRAPELAND <br>
  269. K=> 232 V=> val=GREENVILLE <br>
  270. K=> 233 V=> val=GROESBECK <br>
  271. K=> 234 V=> val=GROVETON <br>
  272. K=> 235 V=> val=HALLSVILLE <br>
  273. K=> 236 V=> val=HALLSVILLE <br>
  274. K=> 237 V=> val=HARDEN JEFFERSON <br>
  275. K=> 238 V=> val=HARLETON <br>
  276. K=> 239 V=> val=HAWKINS <br>
  277. K=> 240 V=> val=HOOKS <br>
  278. K=> 241 V=> val=HOOKS <br>
  279. K=> 242 V=> val=JACKSONVILLE <br>
  280. K=> 243 V=> val=JAOQUIN <br>
  281. K=> 244 V=> val=JEFFERSON <br>
  282. K=> 245 V=> val=KEMP <br>
  283. K=> 246 V=> val=KENNEDALE <br>
  284. K=> 247 V=> val=KILGORE <br>
  285. K=> 248 V=> val=KILGORE <br>
  286. K=> 249 V=> val=KILGORE <br>
  287. K=> 250 V=> val=LEE <br>
  288. K=> 251 V=> val=LEE <br>
  289. K=> 252 V=> val=LEGACY CHRISTIAN <br>
  290. K=> 253 V=> val=LIBERTY CHRISTIAN <br>
  291. K=> 254 V=> val=LIBERTY-EYLAU <br>
  292. K=> 255 V=> val=LIBERTY-EYLAU <br>
  293. K=> 256 V=> val=LIBERTY-EYLAU <br>
  294. K=> 257 V=> val=LINDALE <br>
  295. K=> 258 V=> val=LINDALE <br>
  296. K=> 259 V=> val=LONGVIEW <br>
  297. K=> 260 V=> val=LUFKIN <br>
  298. K=> 261 V=> val=MALAKOFF <br>
  299. K=> 262 V=> val=MAUD <br>
  300. K=> 263 V=> val=MINEOLA <br>
  301. K=> 264 V=> val=MINEOLA <br>
  302. K=> 265 V=> val=MINEOLA <br>
  303. K=> 266 V=> val=MOUNT ENTERPRISE <br>
  304. K=> 267 V=> val=MOUNT PLEASANT <br>
  305. K=> 268 V=> val=MOUNT PLEASANT <br>
  306. K=> 269 V=> val=MOUNT VERNON <br>
  307. K=> 270 V=> val=MOUNT VERNON <br>
  308. K=> 271 V=> val=NACOGDOCHES <br>
  309. K=> 272 V=> val=NACOGDOCHES <br>
  310. K=> 273 V=> val=NEW BOSTON <br>
  311. K=> 274 V=> val=NEW BOSTON <br>
  312. K=> 275 V=> val=NEW BOSTON <br>
  313. K=> 276 V=> val=NEWTON <br>
  314. K=> 277 V=> val=NORTH LAMAR <br>
  315. K=> 278 V=> val=ORE CITY <br>
  316. K=> 279 V=> val=OVERTON <br>
  317. K=> 280 V=> val=PALESTINE <br>
  318. K=> 281 V=> val=PALESTINE <br>
  319. K=> 282 V=> val=PALESTINE <br>
  320. K=> 283 V=> val=PAUL PEWITT <br>
  321. K=> 284 V=> val=PLANO <br>
  322. K=> 285 V=> val=PLEASANT GROVE <br>
  323. K=> 286 V=> val=PLEASANT GROVE <br>
  324. K=> 287 V=> val=PRINCETON <br>
  325. K=> 288 V=> val=PRINCETON <br>
  326. K=> 289 V=> val=PT. NECHES-GROVES <br>
  327. K=> 290 V=> val=QUITMAN <br>
  328. K=> 291 V=> val=QUITMAN <br>
  329. K=> 292 V=> val=ROBINSON <br>
  330. K=> 293 V=> val=ROYSE CITY <br>
  331. K=> 294 V=> val=RUSK <br>
  332. K=> 295 V=> val=RUSK <br>
  333. K=> 296 V=> val=RUSK <br>
  334. K=> 297 V=> val=RUSK <br>
  335. K=> 298 V=> val=SHELBYVILLE <br>
  336. K=> 299 V=> val=SHELBYVILLE <br>
  337. K=> 300 V=> val=SHERMAN <br>
  338. K=> 301 V=> val=SPLENDORA <br>
  339. K=> 302 V=> val=SPRING HILL <br>
  340. K=> 303 V=> val=SPRING HILL <br>
  341. K=> 304 V=> val=SPRING HILL <br>
  342. K=> 305 V=> val=SULPHER SPRINGS <br>
  343. K=> 306 V=> val=SULPHER SPRINGS <br>
  344. K=> 307 V=> val=SUNNYVALE <br>
  345. K=> 308 V=> val=TATUM <br>
  346. K=> 309 V=> val=TATUM <br>
  347. K=> 310 V=> val=TATUM <br>
  348. K=> 311 V=> val=TERRELL <br>
  349. K=> 312 V=> val=TIMPSON <br>
  350. K=> 313 V=> val=TROUP <br>
  351. K=> 314 V=> val=TYLER <br>
  352. K=> 315 V=> val=TYLER <br>
  353. K=> 316 V=> val=UNION GROVE <br>
  354. K=> 317 V=> val=UNION GROVE <br>
  355. K=> 318 V=> val=VAN <br>
  356. K=> 319 V=> val=VAN <br>
  357. K=> 320 V=> val=VAN <br>
  358. K=> 321 V=> val=VAN <br>
  359. K=> 322 V=> val=VIDOR <br>
  360. K=> 323 V=> val=WARREN <br>
  361. K=> 324 V=> val=WASKOM <br>
  362. K=> 325 V=> val=WASKOM <br>
  363. K=> 326 V=> val=WEST HARDIN <br>
  364. K=> 327 V=> val=WEST MONROE <br>
  365. K=> 328 V=> val=WEST ORANGE-STARK <br>
  366. K=> 329 V=> val=WESTWOOD <br>
  367. K=> 330 V=> val=WHITE OAK <br>
  368. K=> 331 V=> val=WHITE OAK <br>
  369. K=> 332 V=> val=WHITEHOUSE <br>
  370. K=> 333 V=> val=WHITEHOUSE <br>
  371. K=> 334 V=> val=WHITESBORO <br>
  372. K=> 335 V=> val=WILLIS POINT <br>
  373. K=> 336 V=> val=WOODVILLE <br>
  374. K=> 337 V=> val=WORTHAM <br>
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement