Vuhelper
09-26-2011, 06:18 PM
// Go through and check all stores
while ($row = mysql_fetch_assoc ($result)) {
// Separate closest stores
$distance = Dist ($row['lat'], $row['lon'], $zip['lat'], $zip['lon']);
$preSpecialties = $row['specialties'];
$preDoor=explode (';',$preSpecialties);
$i=count($preDoor);
for($n=0;$n<$i; $n++){
// Check if store is in radius
if ($distance <= $r && $p == ($preDoor[1]) or ($preDoor[2]) ) {
$stores[] = array (
'name' => $row['name'],
'address' => $row['address'],
'state' => $row['state'],
'town' => $row['town'],
'postal' => $row['postal'],
'phone' => $row['phone'],
'hours' => $row['hours'],
'specialties' => $row['specialties']
);
}
}
}
} else {
$Errors = ($Errors) ? $Errors : '<p>Errors were found please try again!</p>';
}
while ($row = mysql_fetch_assoc ($result)) {
// Separate closest stores
$distance = Dist ($row['lat'], $row['lon'], $zip['lat'], $zip['lon']);
$preSpecialties = $row['specialties'];
$preDoor=explode (';',$preSpecialties);
$i=count($preDoor);
for($n=0;$n<$i; $n++){
// Check if store is in radius
if ($distance <= $r && $p == ($preDoor[1]) or ($preDoor[2]) ) {
$stores[] = array (
'name' => $row['name'],
'address' => $row['address'],
'state' => $row['state'],
'town' => $row['town'],
'postal' => $row['postal'],
'phone' => $row['phone'],
'hours' => $row['hours'],
'specialties' => $row['specialties']
);
}
}
}
} else {
$Errors = ($Errors) ? $Errors : '<p>Errors were found please try again!</p>';
}