

































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


































RAILWAY RESERVATION SYSTEM
Under the guidance of
Department of Computer Engineering
Department of Computer Engineering
The database is a collection of inter-related data which is used to retrieve, insert
and delete the data efficiently. It is also used to organize the data in the form of a
table, schema, views, and reports, etc.
For example: The bank Database organizes the data about the manager, staff,
employees, customers and branch etc.
Using the database, user can easily retrieve, insert, and delete the information.
DBMS allows users the following tasks:
Department of Computer Engineering
Relational database management systems (RDBMS) is used to store and manage
huge volume of data. This is called relational database because all the data is
stored into different tables and relations are established using primary keys or
other keys known as Foreign Keys.
A Relational Database Management System (RDBMS) is a software that:
Department of Computer Engineering
Railway Management System is easy to use, secured and error free system
created using the concepts of MySQL and PHP. It provides a user-friendly
interface while working. Customer can access their respective details anywhere
and anytime. Various functions provided are as follows:
Department of Computer Engineering
Department of Computer Engineering
iv. Updating Data into MySQL Database:
In order to run an UPDATE query with PDO just follow the steps below:
v. Deleting Data from MySQL Database:
Like the UPDATE a WHERE clause ensures the correct record is removed.
Department of Computer Engineering
Index.html
RAILWAY RESERVATION SYSTEM
RAILWAY RESERVATION SYSTEM
New User
Enquiry and Ticket Booking
Ticket History OR Cancellation
Admin Login
admin.html
Department of Computer Engineering
echo "
View all cancelled tickets
"; //echo "
Logout
"; } else { echo "
User ID:
Password:
"; } ?>
Go to Home Page!!!
Booked.php
PNRIdTrain_noDate_Of_Journey< td>FareTrain_ClassSeatsStatus"; while ($row=mysqli_fetch_array($result)) { echo "".$row[0]."".$row[1]."".$row[2]."".$row[5]." ".$row[6]."".$row[7]."".$row[8]."".$row[9]." "; }
Department of Computer Engineering
echo ""; echo "
Go Back to Admin Menu!!! "; $conn->close(); ?>
Cancel.php
query($sql) === TRUE) { echo "Cancellation Successful!!!"; } else { echo "
Error:". $conn->error; } echo "
Home Page
"; $conn->close(); ?>
Db.php
php $servername = "localhost"; $username = "add your sql username here"; $password = "add your sql password here"; $dbname = "railway";
Department of Computer Engineering
$cdresult=mysqli_query($conn,$cdquery); echo " "; while ($cdrow=mysqli_fetch_array($cdresult)) { $cdTitle=$cdrow['sname']; echo " ";
} ?>
Date of Journey:
Go to Home Page!!!
Schedule.php
Train_noTrain_nameStarting_PointArrival_Ti meDestination_PointDeparture_TimeDayDistance
"; while ($cdrow=mysqli_fetch_array($cdresult)) { echo " ".$cdrow['trainno']."".$cdrow['tname']."".$cdrow['sp'] ."".$cdrow['st']."".$cdrow['dp']."".$cdrow['dt']."".$cdrow['dd']."".$cdrow['distance']." "; } echo "";
Department of Computer Engineering
$cdquery="SELECT * FROM schedule where trainno='".$_GET["trainno"]."' ORDER BY distance ASC "; $cdresult=mysqli_query($conn,$cdquery); $stations=array(); $arrival=array(); $departure=array(); $distance=array(); $i=0; while($cdrow=mysqli_fetch_array($cdresult)) { $stations[$i]=$cdrow["sname"]; $arrival[$i]=$cdrow["arrival_time"]; $departure[$i]=$cdrow["departure_time"]; $distance[$i]=$cdrow["distance"]; $i+=1; } echo "
IdStaring_PointArrival_TimeDestination_Poi ntDeparture_TimeDistance "; $temp=0; while ($temp<$i-1) { echo " ".($temp+1)."".$stations[$temp]."".$departure[$temp]." ".$stations[$temp+1]."".$arrival[$temp+1]."".($distan ce[$temp+1]-$distance[$temp])."Seat Plan "; $temp+=1; } echo ""; echo "
Go Back to Train Menu!!!
"; echo "
Go Back to Admin Menu!!! "; ?>
Department of Computer Engineering
require "db.php";
if ($conn->connect_error) { die("Connection failed: ". $conn->connect_error); } $mobile=$_POST["mno"]; $pwd=$_POST["password"]; $query = mysqli_query($conn,"SELECT * FROM user WHERE user.mobileno=$mobile AND user.password='".$pwd."' ") or die(mysql_error()); $temp1; $temp2; if($row = mysqli_fetch_array($query)) { echo "Welcome "; $temp1=$row['emailid']; $temp2=$row['id']; echo "$temp1"; echo "
"; $query2 = mysqli_query($conn," select * from user,resv where user.id=resv.id AND user.mobileno=$mobile ") or die(mysql_error()); echo "PNRTrain_noDate_Of_JourneyTotal_Fa reTrain_ClassSeats_ReservedStatus"; while($row = mysqli_fetch_array($query2)) { echo "".$row["pnr"]."".$row["trainno"]."".$row["doj"]."".$row["tfare"]."".$row["class"]."".$row["nos"]."".$row["status"].""; } echo ""; if(mysqli_num_rows($query2) == 0) { echo "No Reservations Yet !!!
"; } } $_SESSION["id"]=$temp2; //$rowcount=mysqli_num_rows($result); if(mysqli_num_rows($query) == 0) { echo "Wrong Combination!!!
"; echo " Home Page
"; die(); } ?>
Department of Computer Engineering
Enter PNR for Cancellation:
Home Page
"; $conn->close(); ?>
User_Login.html
Enter the details:
Registered Mobile No:
Password:
Home Page
Seat Plan.php
Train_noStarting_PointDestination_Point ".$_GET["trainno"]."".$_GET["sp"]."".$_GET["dp"]."