Ban.php Prob

Results 1 to 1 of 1
  1. #1
    Member Shadow. is offline
    MemberRank
    May 2009 Join Date
    ACTLocation
    66Posts

    Ban.php Prob

    hey i got a prob with my ban.php it nothing will come up only the headings come up not the accounts.

    PHP Code:
    <?php

    require_once('inc/config2.inc.php');
    $color == '#EEEEEE';
    echo 
    '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        <head>
            <link href="style.css" rel="stylesheet" type="text/css"/>  
            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        </head>
        <body>'
    ;

        
    $create_buffer mysql_query("CREATE TABLE IF NOT EXISTS `references` ( 
                                                                    `bancomment` TEXT( 255 ) NULL ,
                                                                    `level` INT( 11 ) NOT NULL ,
                                                                    `charname` VARCHAR( 64 ) NOT NULL ,
                                                                    `class` INT( 11 ) NOT NULL ,
                                                                    `logged_in` INT( 11 ) NOT NULL ,
                                                                    `master` TINYINT( 1 ) NOT NULL
                                                                    ) ENGINE = MYISAM "
    );

        
    $ref_sql mysql_query("SELECT a.bancomment , c.level, c.charname, c.class , a.logged_in FROM characters AS C 
                                                        LEFT JOIN accounts AS a ON a.username = c.accountname
                                                        WHERE a.accesslevel = 0"
    );

        while ( 
    $ref mysql_fetch_row($ref_sql) ) {
            if (
    $ref[3] >= '0' && $ref[3] <= '13') {
                
    $master '0';
            }
            elseif (
    $ref[3] >= '16' && $ref[3] <= '23') {
                
    $master '1';
            }
            elseif (
    $ref[3] >= '24' && $ref[3] <= '31') {
                
    $master '2';
            }
            switch (
    $ref[3]) {
                case 
    0$classnr '0'; break;
                case 
    1$classnr '1'; break;
                case 
    2$classnr '2'; break;
                case 
    3$classnr '3'; break;
                case 
    4$classnr '4'; break;
                case 
    6$classnr '6'; break;
                case 
    7$classnr '7'; break;
                case 
    8$classnr '8'; break;
                case 
    9$classnr '9'; break;
                case 
    10$classnr '10'; break;
                case 
    11$classnr '11'; break;
                case 
    12$classnr '12'; break;
                case 
    13$classnr '13'; break;
                case 
    16$classnr '6'; break;
                case 
    17$classnr '7'; break;
                case 
    18$classnr '8'; break;
                case 
    19$classnr '9'; break;
                case 
    20$classnr '10'; break;
                case 
    21$classnr '11'; break;
                case 
    22$classnr '12'; break;
                case 
    23$classnr '13'; break;
                case 
    24$classnr '6'; break;
                case 
    25$classnr '7'; break;
                case 
    26$classnr '8'; break;
                case 
    27$classnr '9'; break;
                case 
    28$classnr '10'; break;
                case 
    29$classnr '11'; break;
                case 
    30$classnr '12'; break;
                case 
    31$classnr '13'; break;
            }
            
    $add mysql_query("INSERT INTO `references` ( `bancomment` , `level`, `charname`, `class` , `logged_in`, `master` ) VALUES ('".$ref[0]."' , '".$ref[1]."', '".$ref[2]."', '".$classnr."' , '".$ref[4]."','".$master."' ) ");
        }

        
    $row_sql mysql_query("SELECT  bancomment , level , charname, class , logged_in, master FROM `references` 
                                                        ORDER BY master DESC, level DESC, charname ASC"
    );

        echo 
    '<table style="border: 1px solid gray; font-size: 12px;" cellpadding="0" cellspacing="0" width="100%">
                        <tr STYLE="font-style: bold;">
                            <td width="10px"><b>Rank</b></td>
                            <td width="15%"><b>Name</b></td>
                            <td width="20%"><b>Status</b></td>
                            <td width="*%"><b>Reason</b></td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>'
    ;

        
    $i '0';
        while( 
    $row mysql_fetch_row($row_sql) ) {
        
    $i++;
        if (
    $row[4] == '0') {
            
    $status '<img src="img/ban.png">';
        } else {
            
    $status '<img src="img/ban.png">';
        }

        if (
    $color == '#EEEEEE') {
                
    $color '#FFFFFF';
            } else {
                
    $color '#EEEEEE';
        }

        echo 
    '<tr bgcolor='.$color.'>
                        <td>'
    .$i.'</td>                    
                        <td><b>'
    .$row[2].'</b></td>  
                        <td>'
    .$status.'</td>
                        <td>'
    .$row[0].'</td>
                    </tr>'
    ;
            if (
    $i '99') {
                break;
            }
        }

        echo 
    '</table>';

        
    $clear mysql_query("DROP TABLE `references`");

        echo 
    '</table>';

        echo 
    '</body>
                    </html>'
    ;

    ?>




Advertisement