Jump to content

My Php Problem


help me please

Recommended Posts

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/sphinx/public_html/hforums/dodianv2/index.php on line 69

 

my query:

<?php
session_start();

?>
<html>
<head>
<?php
include "functions.php";
?>
<style type="text/css">
body {
color: white;
background-color: grey;
font-family: Verdana, Arial, Sans-Serif;
font-size: 15px;
}
a
{
color: white;
text-decoration: none;
}
a:hover
{
color: gray;
text-decoration: underline;
}
tr
{
font-size: 15px;
}
tr#top
{
background-image: url('images/top.PNG');
color: black;
font-weight: bold;
}
a#top
{
color: black;
}
tr#tabletop
{
background-image: url('images/tabletop.PNG');
}
</style>
<title>The-Lost-Isle StatusPage</title>
</head>
<body>
<?php
include "connect.php";
echo "<center>";
if(isset($_SESSION['admin']))
{
echo '<table cellpadding="2" border="1" width="100%">';
}
else
{
echo '<table cellpadding="2" border="1" width="70%">';
}
if(isset($_SESSION['admin']))
{
echo '<tr id="tabletop"><td><strong>IP</strong></td><td><strong>Port</strong></td><td><b>Type</b></td><td><strong>Status</strong></td><td><strong>Edit</strong></td><td><strong>Delete</strong></td><td><strong>Ban</strong></td></tr>';
}
else
{
echo '<tr id="tabletop"><td><strong>IP</strong></td><td><strong>Port</strong></td><td><b>Type</b></td><td><strong>Status</strong></td></tr>';
}
$k = mysql_query("SELECT * FROM servers ORDER BY top");
while($l = mysql_fetch_array($k))
{
    $check = @fsockopen($l['ip'],$l['port'],$errorNumber,$errorMessage,1);
    if($check){
        if(isset($_SESSION['admin']))
        {
        if($l['top'] == 0)
          {
          echo '<tr id="top"><td><a id="top" href="view.php?server='. $l['id'] .'">'. $l["name"] .'</a></td><td>'. $l["ip"] .'</td><td>'. $l["port"] .'</td><td>'. $l["type"] .'</td><td width="5%" style="background-color: black;"><img src="images/online.png"></td><td width="5%"><a id="top" href="edit-server.php?id='. $l["id"] .'">Edit</a></td><td width="5%"><a id="top" href="delete-server.php?id='. $l["id"] .'">Delete</a></td><td width="5%"><a id="top" href="ban-ip.php?ip='. $l["ip2"] .'">Ban</a></td></tr>';
          }
          else
          {
          echo '<tr><td><a href="view.php?server='. $l['id'] .'">'. $l["name"] .'</a></td><td>'. $l["ip"] .'</td><td>'. $l["port"] .'</td><td>'. $l["type"] .'</td><td width="5%"><img src="images/online.png"></td><td width="5%"><a href="edit-server.php?id='. $l["id"] .'">Edit</a></td><td width="5%"><a href="delete-server.php?id='. $l["id"] .'">Delete</a></td><td width="5%"><a href="ban-ip.php?ip='. $l["ip2"] .'">Ban</a></td></tr>';
          }
        }
        else
        {
        if($l['top'] == 0)
          {
          echo '<tr id="top"><td><a id="top" href="view.php?server='. $l['id'] .'">'. $l["name"] .'</a></td><td>'. $l["ip"] .'</td><td>'. $l["port"] .'</td><td>'. $l["type"] .'</td><td width="5%" style="background-color: black;"><img src="images/online.png"></td></tr>';
          }
          else
          {
          echo '<tr><td><a href="view.php?server='. $l['id'] .'">'. $l["name"] .'</a></td><td>'. $l["ip"] .'</td><td>'. $l["port"] .'</td><td>'. $l["type"] .'</td><td width="5%"><img src="images/online.png"></td></tr>';
          }
        }
    } else {
        if(isset($_SESSION['admin']))
        {
        if($l['top'] == 0)
          {
          echo '<tr id="top"><td><a id="top" href="view.php?server='. $l['id'] .'">'. $l["name"] .'</a></td><td>'. $l["ip"] .'</td><td>'. $l["port"] .'</td><td>'. $l["type"] .'</td><td width="5%" style="background-color: black;"><img src="images/offline.png"></td><td width="5%"><a id="top" href="edit-server.php?id='. $l["id"] .'">Edit</a></td><td width="5%"><a id="top" href="delete-server.php?id='. $l["id"] .'">Delete</a></td><td width="5%"><a id="top" href="ban-ip.php?ip='. $l["ip2"] .'">Ban</a></td></tr>';
          }
          else
          {
          echo '<tr><td><a href="view.php?server='. $l['id'] .'">'. $l["name"] .'</a></td><td>'. $l["ip"] .'</td><td>'. $l["port"] .'</td><td>'. $l["type"] .'</td><td width="5%"><img src="images/offline.png"></td><td width="5%"><a href="edit-server.php?id='. $l["id"] .'">Edit</a></td><td width="5%"><a href="delete-server.php?id='. $l["id"] .'">Delete</a></td><td width="5%"><a href="ban-ip.php?ip='. $l["ip2"] .'">Ban</a></td></tr>';
          }
        }
        else
        {
        if($l['top'] == 0)
          {
          echo '<tr id="top"><td><a id="top" href="view.php?server='. $l['id'] .'">'. $l["name"] .'</a></td><td>'. $l["ip"] .'</td><td>'. $l["port"] .'</td><td>'. $l["type"] .'</td><td width="5%" style="background-color: black;"><img src="images/offline.png"></td></tr>';
          }
          else
          {
          echo '<tr><td><a href="view.php?server='. $l['id'] .'">'. $l["name"] .'</a></td><td>'. $l["ip"] .'</td><td>'. $l["port"] .'</td><td>'. $l["type"] .'</td><td width="5%"><img src="images/offline.png"></td></tr>';
          }
        }
    } 
  }
  echo "</table><br>";
  echo "<a href='addserver.php'>Add Server</a><br>";
  if(isset($_SESSION['admin']))
  {
  echo "<a href='logout.php'>Logout</a>";
  }
  else
  {
  echo "<a href='login.php'>Login</a>";
  }
  echo "<br><br><br><Br><b><font color='yellow'>For information. You can talk to [email protected] on msn</b></font>";
  echo "</center>";
/*}*/
?> 

 

anyhelp

 

 

Link to comment
https://forums.phpfreaks.com/topic/151504-my-php-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.