Hello can somebody explain the code to me thx in advance!!
[PHP]
<?php
$temp="";
$sqlconnect=mys ql_connect("loc alhost","hyperi an_track","__mu nged__");
if(!$sqlconnect )
die(mysql_error ());
mysql_select_db ("hyperian_trac k", $sqlconnect);
if($_GET['postal']))
$postalcode=sub str($_GET['postal'],0,2); //will return from 0 position 2 characters
$resultpostal=m ysql_query("SEL ECT startlat,endlat ,startlng,endln g FROM districts
WHERE districtno = $postalcode"); //get startlat,endlat ,startlng,endln g of location
while($row = mysql_fetch_arr ay($resultposta l))
{
$temp[]=$row; // store each record in an array
}
$resultname=mys ql_query("SELEC T uname FROM location,distri cts
WHERE location.lat < districts.start lat AND location.lat > districts.endla t AND location.lng < districts.start lng
AND location.lng > districts.endln g");
while($row = mysql_fetch_arr ay($resultname) )
{
$temp[]=$row;
}
foreach($temp as $key=>$extract)
$reportname=$re portname.$key." =".$extract."&" ;
echo '&reportname& ';
}//end of if loops
mysql_close($co n);
[/PHP]
[PHP]
<?php
$temp="";
$sqlconnect=mys ql_connect("loc alhost","hyperi an_track","__mu nged__");
if(!$sqlconnect )
die(mysql_error ());
mysql_select_db ("hyperian_trac k", $sqlconnect);
if($_GET['postal']))
$postalcode=sub str($_GET['postal'],0,2); //will return from 0 position 2 characters
$resultpostal=m ysql_query("SEL ECT startlat,endlat ,startlng,endln g FROM districts
WHERE districtno = $postalcode"); //get startlat,endlat ,startlng,endln g of location
while($row = mysql_fetch_arr ay($resultposta l))
{
$temp[]=$row; // store each record in an array
}
$resultname=mys ql_query("SELEC T uname FROM location,distri cts
WHERE location.lat < districts.start lat AND location.lat > districts.endla t AND location.lng < districts.start lng
AND location.lng > districts.endln g");
while($row = mysql_fetch_arr ay($resultname) )
{
$temp[]=$row;
}
foreach($temp as $key=>$extract)
$reportname=$re portname.$key." =".$extract."&" ;
echo '&reportname& ';
}//end of if loops
mysql_close($co n);
[/PHP]
Comment