prepare("SELECT * FROM trains WHERE train_no = ?"); $tq->execute([$no]); $train = $tq->fetch(PDO::FETCH_ASSOC); if (!$train) { http_response_code(404); $page_title = 'Train ' . $no . ' not found'; $meta_robots = 'noindex'; require APP_DIR . '/header.php'; echo '

Train ' . e($no) . ' not found

' . '

We don\'t have this train number yet. ' . 'Search journeys instead.

'; require APP_DIR . '/footer.php'; exit; } $sq = $pdo->prepare( "SELECT s.seq, s.station_code, st.name AS sname, s.arrival, s.departure, s.day_offset, s.distance FROM train_stops s LEFT JOIN stations st ON st.code = s.station_code WHERE s.train_no = ? ORDER BY s.seq" ); $sq->execute([$no]); $stops = $sq->fetchAll(PDO::FETCH_ASSOC); $verified = !empty($train['run_days']); $nm = $train['train_name'] ?: ('Train ' . $no); $src = $train['source_code']; $dst = $train['dest_code']; $srcName = $stops[0]['sname'] ?? $src; $dstName = $stops ? ($stops[count($stops) - 1]['sname'] ?? $dst) : $dst; $daysTxt = rr_run_days_text($train['run_days'] ?? null); [$classLabel, $isUn] = rr_classify($no, $train['train_type'] ?? ''); $typeLabel = rr_type_label($train['train_type'] ?? ''); $nStops = count($stops); $totalKm = $stops ? (int) ($stops[count($stops) - 1]['distance'] ?? 0) : 0; $page_title = $no . ' ' . $nm . ' — Time Table & Route'; $meta_description = $no . ' ' . $nm . ' (' . $typeLabel . ') runs ' . $daysTxt . '. Schedule with arrival & departure times for ' . $nStops . ' stations from ' . $srcName . ' to ' . $dstName . '. Indicative times — verify before travel.'; $canonical = rr_abs(rr_train_url($no)); if (!$verified) $meta_robots = 'noindex'; $ld = [ '@context' => 'https://schema.org', '@type' => 'TrainTrip', 'trainNumber' => $no, 'trainName' => $nm, 'departureStation' => ['@type' => 'TrainStation', 'name' => $srcName, 'identifier' => $src], 'arrivalStation' => ['@type' => 'TrainStation', 'name' => $dstName, 'identifier' => $dst], ]; if ($stops) { if (!empty($stops[0]['departure'])) $ld['departureTime'] = substr($stops[0]['departure'], 0, 5); $last = $stops[count($stops) - 1]; if (!empty($last['arrival'])) $ld['arrivalTime'] = substr($last['arrival'], 0, 5); } $crumb = ['@context' => 'https://schema.org', '@type' => 'BreadcrumbList', 'itemListElement' => [ ['@type' => 'ListItem', 'position' => 1, 'name' => 'Home', 'item' => rr_abs('/')], ['@type' => 'ListItem', 'position' => 2, 'name' => $no . ' ' . $nm, 'item' => $canonical], ]]; $head_extra = '' . ''; require APP_DIR . '/header.php'; ?>

·

Runs on
Stops
Distance
0 ? e($totalKm) . ' km' : '—' ?>
Booking
We're still confirming this train's timetable. Details below may be incomplete.

Schedule & route

$st): ?>
# Station Arr Dep Day Km
()

About this train

is a running between () and (). It operates and calls at stations.

Timings are indicative, based on a reference timetable. Always confirm on the official Indian Railways / IRCTC sources before booking or travel.

All trains