jkmaster9918
New Member
- Messages
- 2
- Reaction score
- 0
- Points
- 0
My script is terminating in different places every time for no apparent reason. Does anyone have an idea why? You can find this Here. (Yes, some stuff may seem useless, but that is because I changed some stuff to figure out where it is dying.)
PHP:
<html>
<head>
<title>The Honor Guard Location Manager Torpia Display Page</title>
<link rel="stylesheet" type="text/css" href="balloontip.css" />
<script type="text/javascript" src="balloontip.js">
/***********************************************
* Rich HTML Balloon Tooltip- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
<style type='text/css'>
.good
{
background-color: green;
cell-padding: 5px;
}
.evil
{
background-color: red;
cell-padding: 5px;
}
</style>
</head>
<body>
<?php
require("connect.php");
$db_connection=new mysqli($server,$username,$password,$database);
print "<table border=1>";
for($y=1000;$y>0;$y--)
{
print "<tr>";
for($x=-1000;$x<=1000;$x++)
{
$result=$db_connection->query("SELECT `V_type`,`Owner`,`village_name` FROM locations WHERE `Coord_X`=$x AND `Corrd_Y`=$y");
if(is_bool($result))
{
$output="<td border=1>_placeholder</td>\n";
}
else
{
$loc_data=$result->fetch_assoc();
$output="<a href='http://w1.torpia.com/tile/tile/$x/$y' rel='$x|$y'><td border=1 class='".$loc_data['V_type']."'>_placeholder</td></a><div class='balloonstyle' id='$x|$y'>".$loc_data['village_name']."- Owned by:".$loc_data['Owner']."(".$loc_data['V_type'].")</div>\n";
}
$placeholder="";
if($x==0)
{
if(($y%100)==0)
{
$placeholder="$y";
}
else
{
$placeholder="|";
}
}
$output=str_replace("_placeholder","$x|$y",$output);
print $output;
}
print "</tr>";
$db_connection->ping();
}
print "<tr>";
for($x=-1000;$x<=1000;$x++)
{
$result=$db_connection->query("SELECT `V_type`,`Owner` FROM locations WHERE `Coord_X`=$x AND `Corrd_Y`=0");
if(is_bool($result))
{
$output="<td>_placeholder</td>\n";
}
else
{
$loc_data=$result->fetch_assoc();
$output="<a href='http://w1.torpia.com/tile/tile/$x/0' rel='$x|0'><td class='".$loc_data['V_type']."'>_placeholder</td></a><div class='balloonstyle' id='$x|0'>".$loc_data['village_name']."- Owned by:".$loc_data['Owner']."(".$loc_data['V_type'].")</div>\n";
}
$placeholder="";
if(($x%100)==0 and $x!=0)
{
$placeholder="$x";
}
elseif($x==0)
{
$placeholder="+";
}
else
{
$placeholder="-";
}
$output=str_replace("_placeholder",$placeholder,$output);
print $output;
}
print "</tr>";
for($y=-1;$y>=-1000;$y--)
{
print "<tr>";
for($x=-1000;$x<=1000;$x++)
{
$result=$db_connection->query("SELECT `V_type`,`Owner` FROM locations WHERE `Coord_X`=$x AND `Corrd_Y`=$y");
if(is_bool($result))
{
$output="<td>_placeholder</td>\n";
}
else
{
$loc_data=$result->fetch_assoc();
$output="<a href='http://w1.torpia.com/tile/tile/$x/$y' rel='$x|$y'><td class='".$loc_data['V_type']."'>_placeholder</td></a><div class='balloonstyle' id='$x|$y'>".$loc_data['village_name']."- Owned by:".$loc_data['Owner']."(".$loc_data['V_type'].")</div>\n";
}
$placeholder="";
if($x==0)
{
if(($y%100)==0)
{
$placeholder="$y";
}
else
{
$placeholder="|";
}
}
$output=str_replace("_placeholder",$placeholder,$output);
print $output;
}
print "</tr>";
}
print "</table>";
$db_connection->close();
?>