<?php
include_once("includes.php");

//  let's make a connection and select the db
mysql_connect($DBserver$DBuser$DBpass) or die(mysql_error());
@
mysql_select_db("knigga5_news") or die(mysql_error());

//  get fun
$sqlstring "SELECT id, name, url FROM links WHERE cat = 0 ORDER BY name;";
$sqlqueryresult mysql_query($sqlstring) or die(mysql_error());
while (
$row mysql_fetch_array($sqlqueryresult)) {
     
$funArray[] = $row;
};

//  get profit
$sqlstring "SELECT id, name, url FROM links WHERE cat = 1 ORDER BY name;";
$sqlqueryresult mysql_query($sqlstring) or die(mysql_error());
while (
$row mysql_fetch_array($sqlqueryresult)) {
     
$profitArray[] = $row;
};

//  get stalkers
$sqlstring "SELECT id, name, url FROM links WHERE cat = 2 ORDER BY name;";
$sqlqueryresult mysql_query($sqlstring) or die(mysql_error());
while (
$row mysql_fetch_array($sqlqueryresult)) {
     
$stalkerArray[] = $row;
};

//  close db connection!
mysql_close();

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<?php include("meta.html"); ?>
<title> www.KNIGGA.com - links </title>
</head>
<body>
<p align="center">
<font size="5">www.KNIGGA.com - links</font>
</p>
<hr noshade width="80%">
<?php include("header.html"); ?>
<table cellpadding="0" border="0" align="center" cellspacing="0">
 <tr>
  <td width="175" valign="top" align="right">
   <font size="+1"><b> for fun </b></font>
  </td>
  <td width="20">&nbsp;</td>
  <td width="1" bgcolor="#ffffff"><img height="1" hspace="0" vspace="0" width="1" border="0" alt="vr" align="left" src="/images/transpix.gif"></td>
  <td width="20">&nbsp;</td>
  <td width="175" valign="top" align="center">
   <font size="+1"><b> for profit </b></font>
  </td>
  <td width="20">&nbsp;</td>
  <td width="1" bgcolor="#ffffff"><img height="1" hspace="0" vspace="0" width="1" border="0" alt="vr" align="left" src="/images/transpix.gif"></td>
  <td width="20">&nbsp;</td>
  <td width="175" valign="top" align="left">
   <font size="+1"><b> for stalkers </b></font>
  </td>
 </tr>
 <tr>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td valign="bottom" width="1"><img height="3" hspace="0" vspace="0" width="1" border="0" alt="vr" align="left" src="/images/blackpix.gif"></td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
 </tr>
 <tr>
  <td valign="top" align="right">
   <?php
   
foreach ($funArray as $i => $value)
   {
?>
   <!-- link id: <?php echo $funArray[$i]['id']; ?> --><a href="<?php echo $funArray[$i]['url']; ?>"><?php echo $funArray[$i]['name']; ?></a><br>
   <?php ?>
  </td>
  <td>&nbsp;</td>
  <td BGCOLOR="#000000"><img HEIGHT="1" HSPACE="0" VSPACE="0" WIDTH="1" BORDER="0" ALT="vr" ALIGN="left" src="/images/transpix.gif"></td>
  <td>&nbsp;</td>
  <td ALIGN="center" VALIGN="top">
   <?php
   
foreach ($profitArray as $i => $value)
   {
?>
   <!-- link id: <?php echo $profitArray[$i]['id']; ?> --><a href="<?php echo $profitArray[$i]['url']; ?>"><?php echo $profitArray[$i]['name']; ?></a><br>
   <?php ?>
  </td>
  <td>&nbsp;</td>
  <td BGCOLOR="#000000"><img HEIGHT="1" HSPACE="0" VSPACE="0" WIDTH="1" BORDER="0" ALT="vr" ALIGN="left" src="/images/transpix.gif"></td>
  <td>&nbsp;</td>
  <td ALIGN="left" VALIGN="top">
   <?php
   
foreach ($stalkerArray as $i => $value)
   {
?>
   <!-- link id: <?php echo $stalkerArray[$i]['id']; ?> --><a href="<?php echo $stalkerArray[$i]['url']; ?>"><?php echo $stalkerArray[$i]['name']; ?></a><br>
   <?php ?>
  </td>
 </tr>
</table>
<?php include("footer.html"); ?>
</body>
</html>