where says #get working not out anything.. echoing $where , looks data there nothing..
$zoom = '4'; $sql1 = "select min(xcoord) min_x, max(xcoord) max_x, min(ycoord) min_y, max(ycoord) max_y adlplanet"; $result1 = mysql_query($sql1); $row1 = mysql_fetch_array($result1); # create extremes $x_max = $row1['max_x']; $x_min = $row1['min_x']; $y_max = $row1['max_y']; $y_min = $row1['min_y']; # calculate size of map based on inputs user $x_range = 800; $y_range = 600; $x_center = $x_max - $x_min - $x_range; $y_center = $y_max - $y_min - $y_range; $jump = 30; #get working $xlim = "(xcoord * $zoom) - $x_min - ($x_offset * $zoom) - ($x_center / 2)"; $ylim = "$y_max - (ycoord * $zoom) + ($y_offset * $zoom) - ($y_center / 2)"; $where = "($xlim > 0) , ($xlim < $x_range) , ($ylim > 0) , ($ylim < $y_range)"; echo $where; $sql2 = "select * adlplanet $where"; $result2 = mysql_db_query($sql2); #$row2 = mysql_fetch_array($result2); while ($row2 = mysql_fetch_array($result2)) { echo $row2['planetkey']; echo '<br><br> '; }
( * 4) not work.. check $x_offset , $y_offset set
Comments
Post a Comment