Update:
I added two custom HTML attributes to the script that I will increment using PHP.
Attributes:
data-coordx="'.$coordx.'"
data-coordy="'.$coordy.'"
I'm not sure if this is the proper way to do so, but to increment I did:
for( $coordx = 0; $coordx < $maxcoord; $coordx++ );
for( $coordy = 0; $coordy < $maxcoord; $coordy++ );
Now I have my custom coordinates attribute. I will be using these values to compare to the SQL WHERE clause when pulling data.
Additionally, I've added it to the DOM parser so that I can convert the value into a variable for use in PHP dynamically:
$areaCoordx = $value->data-coordx;
$areaCoordy = $value->data-coordy;
Last but not least, I've decided to try calling a function to populate fields in the "info" div based on DB data:
<?php
// dataFiller Function
function dataFiller()
{
include ("includes/connections.php");
// Retrieve Data
$result = mysql_query("SELECT mType, mLevel, mCoordx, mCoordy, mOwner, mAlliance, mFlag, mLord, mImage FROM locations WHERE mCoordx='$areaCoordx' AND mCoordy='$areaCoordy'");
return array (0, 1, 2);
// Close Connecction
mysql_close($sql);
}
?>
I'm not sure how accurate my syntax is. Any help is welcome. If I can get some help finishing that function too that would be awesome. I need to store the data into an array and echo it into the "info" div. Maybe something like this will do?:
<div id="info" style="display:none">
<h4>Area Information</h4>
<?php include ("script.php"); // Include Simple HTML DOM Script
list ($mType, $mLevel, $mCoordx, $mCoordy, $mOwner, $mAlliance, $mFlag, $mLord, $mImage) = dataFiller();
?>
</div>
I added a new ZIP containing all the files if you're interested. Thanks.
[attachment deleted by admin]