Buenas, estoy montando la web de estadísticas de este plugin:
https://forums.alliedmods.net/showth...highlight=rank
El cual viene para descargarlo, al montarlo y tal me sucede este error:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in
C:\xampp\htdocs\rank\index.php on line
19
Mi index.php
PHP Code:
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<link rel="stylesheet" type="text/css" href="styles.css" />
<script src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/jquery.titlecase.js"></script>
<script type="text/javascript" src="js/jquery.blockUI.js"></script>
<script src="scripts.js"></script>
<body onload="make_oddeven(0)">
<?php
include_once "check_restore.php";
global $bd_table;
$query1 = "SELECT * FROM `$bd_table` ORDER BY score DESC";
$resultado1 = $conexao->query($query1);
echo "<span style='margin:auto;display:block;text-align:center;color:white;'>Click a player name for detailed statistics.</span><br />";
echo "<table id='table1' align='center'><tr><th>POSITION</th><th>NAME</th><th>STEAMID</th><th>SCORE</th><th>KDR</th><th>HEADSHOTS</th><th>ACCURACY</th></td>";
$rank=0;
while ($row = mysql_fetch_array($resultado1)) { LINEA 19
$rank++;
if($row['hits'] == 0){
$hits = 1;
} else {
$hits = $row['hits'];
}
if($row['deaths'] == 0){
$deaths = 1;
} else {
$deaths = $row['deaths'];
}
if($row['shots'] == 0){
$shots = 1;
} else {
$shots = $row['shots'];
}
$accuracy = "";
$temp = strval($row['hits']/$shots);
//$accuracy = $temp;
if(strpos($temp,".") !== false){
for($i = 0; $i<=strpos($temp,".")+2;$i++){
if( strlen($temp)-1 <$i ){
$accuracy .= "";
}else{
$accuracy = $accuracy . $temp[$i];
}
}
} else { $accuracy = $temp . ".00";}
echo "<tr align=center onclick=\"showmodal('showplayer.php?id={$row['id']}')\"><td>$rank</td><td>" . $row['name'] . "</td><td>{$row['steam']}</td><td>{$row['score']}</td><td>";
$temp = strval($row['kills']/$deaths);
if(strpos($temp,".") !== false){
for($i = 0; $i<=strpos($temp,".")+2;$i++){
if( strlen($temp)-1 <$i ){
break;
}else{
echo $temp[$i];
}
}
} else { echo $temp . ".00";}
echo "</td><td>{$row['headshots']}</td><td>" . $accuracy . "</td></tr>";
}
// close connection
$logdb = null;
?>
<div id="modal"></div>
No tengo ni idea de php, alguien me podria echar una mano?
Un saludo y gracias!