Raised This Month: $51 Target: $400
 12% 

Ayuda- estadisticas de un plugin para web


  
 
 
Thread Tools Display Modes
Author Message
Keros
Member
Join Date: Aug 2013
Old 09-02-2013 , 03:09   Ayuda- estadisticas de un plugin para web
#1

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)-<$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)-<$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!

Last edited by Keros; 09-02-2013 at 03:10.
Keros is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 09-02-2013 , 09:42   Re: Ayuda- estadisticas de un plugin para web
#2

El problema no es del plugin , es del codigo PHP , por ende , a offtopic!
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 09-05-2013 , 10:16   Re: Ayuda- estadisticas de un plugin para web
#3

Creo que es muy dificil que te ayuden en php en este subforo, lo mejor sería que los postees en la sección en inglés que corresponda o en otro foro
__________________
alan_el_more is offline
ILUSION
Senior Member
Join Date: Oct 2006
Location: Argentina
Old 09-05-2013 , 13:20   Re: Ayuda- estadisticas de un plugin para web
#4

Lo más probable es que la consulta no esté devolviendo nada... hacé lo siguiente

Abajo de:
PHP Code:
$query1 "SELECT * FROM `$bd_table` ORDER BY score DESC"
Agregá:
PHP Code:
echo $query


Y fijate que dice..
__________________

Last edited by ILUSION; 09-05-2013 at 13:20.
ILUSION is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:33.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode