%PDF- %PDF-
| Direktori : /data/www_bck/varak.net_bck/wow2.varak.net/loot/ |
| Current File : //data/www_bck/varak.net_bck/wow2.varak.net/loot/threat.php |
<?php
function q($query,$assoc=0)
{
$r = @mysql_query($query);
if( mysql_errno() ) {
$error = 'MYSQL ERROR #'.mysql_errno().' : <small>' . mysql_error(). "</small><br><VAR>$query</VAR>";
echo($error); return FALSE;
}
$queries++;
if( strtolower(substr($query,0,6)) != 'select' ) return array(mysql_affected_rows(),mysql_insert_id());
$count = @mysql_num_rows($r);
if( !$count ) return 0;
if( $count == 1 ) {
if( $assoc ) $f = mysql_fetch_assoc($r);
else $f = mysql_fetch_row($r);
mysql_free_result($r);
if( count($f) == 1 ) {
list($key) = array_keys($f);
return $f[$key];
} else {
$all = array();
$all[] = $f;
return $all;
}
} else {
$all = array();
for( $i = 0; $i < $count; $i++ ) {
if( $assoc ) $f = mysql_fetch_assoc($r);
else $f = mysql_fetch_row($r);
$all[] = $f;
}
mysql_free_result($r);
return $all;
}
}
?>
<center>
<?php
include "config.php";
$spojeni = mysql_connect($sql, $usr, $pass);
mysql_select_db($db, $spojeni);
$loot = q("select entry, threat from spell_threat where entry not in (17752,19577,24394,17751,14921,11775,17750,11774,7811,17735,7810,7809,3716,24583,11785) order by threat desc");
$loot2 = q("select entry, threat from spell_threat where entry in (17752,19577,24394,17751,14921,11775,17750,11774,7811,17735,7810,7809,3716,24583,11785) order by threat desc");
$i = 0;
mysql_close($spojeni);
if($loot)
{
echo "<table width=\"400\" border=\"1\">
<tr>
<th width=\"10%\"> </th>
<th width=\"25%\">ID</th>
<th width=\"35%\">Threat</th>
</tr>";
foreach($loot as $l)
{
$i++;
echo "<tr>
<td>$i</td>
<td><a href=\"http://wowhead.com?spell=$l[0]\">$l[0]</a></td>
<td>$l[1]</td
</tr>\n";
}
echo "</table>";
}
else
{
echo "Item v databazi neexistuje";
}
$i = 0;
if($loot2)
{
echo "<h2>Threat petu</h2>
<table width=\"400\" border=\"1\">
<tr>
<th width=\"10%\"> </th>
<th width=\"25%\">ID</th>
<th width=\"35%\">Threat</th>
</tr>";
foreach($loot2 as $l)
{
$i++;
echo "<tr>
<td>$i</td>
<td><a href=\"http://wowhead.com?spell=$l[0]\">$l[0]</a></td>
<td>$l[1]</td
</tr>\n";
}
echo "</table>";
}
?>
</center>