Advertisement
Neo-Craft

9xEmu item searcher

Feb 26th, 2012
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. <?php
  2. mysql_connect('localhost', 'root', '');
  3. mysql_select_db('9xemu');
  4. if(isset($_GET['l']))
  5.     $list = $_GET['l'];
  6. else
  7.     die('Please enter the list');
  8. $list = explode(',', $list);
  9. $found = array();
  10. foreach($list as $k=>$v)
  11. {
  12.     $query = mysql_query("SELECT COUNT(Id) AS c FROM itemtemplate WHERE Id='$v'");     
  13.     $f = mysql_fetch_assoc($query);
  14.     if((int)$f['c']===1)
  15.         $found[]=$v;
  16. }
  17. echo 'Task Finished. '.count($found).' Items found. Ids Are: '.implode(',',$found);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement