Select a from/to pair...
" . trim($timetable["time_points"][$i + 1])] .= $timetable["short_name"] . ";"; } } } } ksort($paths); $completedPaths = array(); $result_betweenstops = pg_query($conn, "Select * FROM between_stops"); while ($path = pg_fetch_assoc($result_betweenstops)) { $completedPaths[trim($path['fromlocation']) . "->" . trim($path['tolocation'])] .= trim($path['routes']); } foreach ($paths as $path => $routes) { if (!in_array($path, array_keys($completedPaths))) { echo "
" . sizeof(explode(";", $routes)) . " $path
\n"; } else { $completedRoutes = explode(";", $completedPaths[$path]); $incompleteRoutes = ""; foreach (explode(";", $routes) as $route) { if (!in_array($route,$completedRoutes)) { $incompleteRoutes .= $route.';'; } } if ($incompleteRoutes != "") echo "
" . sizeof(explode(";", $incompleteRoutes)) . " $path
\n"; } } ?>
from
to
on routes
Reverse?