PHP Error Code
#1

PHP код:
<?php 
        $query 
mysql_query("SELECT `id`,`Name`,`AdminLevel` FROM `players` WHERE `AdminLevel` >0 ORDER BY `AdminLevel` DESC");
        echo 
'<table>';
        echo 
'<tr><td>id</td><td>Name</td><td>Level</td></tr>';
        while (
$row mysql_fetch_array($query)) 
        {
            if(!isset(
$string))   $string $row['Name'] . ", ";
            else 
$string $string $row['Name'] . ", ";
            echo 
'<tr><td>'.$row['id'].'</td><td>'.$row['Name'].'</td><td>'.$row['AdminLevel'].'</td></tr>';
        }
        echo 
'</table>';
        for (
$i=5$i>0$i--)
        {
            if(
$i == 666)  echo "<h2>Owner</h2>";
            else echo 
"<h2>Level $i</h2>";
            
$result mysql_query("SELECT `Name` FROM `players` WHERE AdminLevel = $i");
            if(!
mysql_num_rows($result)) echo "None";
            else
            {
                while (
$row mysql_fetch_array($resultMYSQL_ASSOC)) 
                {
                    if(!isset(
$string))   $string $row['user'] . ", ";
                    else 
$string $string $row['user'] . ", ";
                }
                
$string=substr($string,0,(strlen($string)-2));
                echo 
$string;
            }
            echo 
"<p>";
            
$string '';
        }
        
?>
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in line 2
Reply
#2

Means your query failed. But this isn't the right section for this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)