prepare("SELECT name FROM stations WHERE code = ?"); $fn->execute([$from]); $fromName = $fn->fetchColumn() ?: $from; $tn = $pdo->prepare("SELECT name FROM stations WHERE code = ?"); $tn->execute([$to]); $toName = $tn->fetchColumn() ?: $to; $q = $pdo->prepare( "SELECT t.train_no, t.train_name, t.train_type, t.run_days, a.departure AS dep, b.arrival AS arr, (b.day_offset - a.day_offset) AS doff FROM train_stops a JOIN train_stops b ON b.train_no = a.train_no AND b.seq > a.seq JOIN trains t ON t.train_no = a.train_no WHERE a.station_code = ? AND b.station_code = ? AND t.run_days IS NOT NULL ORDER BY a.departure" ); $q->execute([$from, $to]); $rows = $q->fetchAll(PDO::FETCH_ASSOC); $cnt = count($rows); $page_title = 'Trains from ' . $fromName . ' to ' . $toName . ' — Time Table'; $meta_description = ($cnt ? $cnt . ' direct trains' : 'Direct & connecting trains') . ' from ' . $fromName . ' (' . $from . ') to ' . $toName . ' (' . $to . ') ' . 'with departure and arrival times, plus multi-train connecting journeys. Indicative times — verify before travel.'; $canonical = rr_abs(rr_route_url($from, $to)); $crumb = ['@context' => 'https://schema.org', '@type' => 'BreadcrumbList', 'itemListElement' => [ ['@type' => 'ListItem', 'position' => 1, 'name' => 'Home', 'item' => rr_abs('/')], ['@type' => 'ListItem', 'position' => 2, 'name' => $fromName . ' to ' . $toName, 'item' => $canonical], ]]; $head_extra = ''; require APP_DIR . '/header.php'; ?>
= e($from) ?> → = e($to) ?> · = e($cnt) ?> direct trains
No direct trains found. Use the planner above — connecting journeys (with a change of train) may still get you there.
| Train | Name | Dep | Arr | Runs |
|---|---|---|---|---|
| = e($r['train_no']) ?> | = e($r['train_name'] ?: '') ?> | = e(rr_time($r['dep'])) ?> | = e(rr_time($r['arr'])) ?>= ((int) $r['doff'] > 0) ? ' +' . (int) $r['doff'] . 'd' : '' ?> | = e(rr_run_days_text($r['run_days'])) ?> |
Our planner also finds connecting journeys — transfers at any shared station, not just major junctions. Indicative times; verify on official sources before travel.