$train_arrival=$row2['train_arrival'];//Arrival Time
$train_date=$row2['train_date'];// Train Date
$sql1="SELECT * FROM best_seat WHERE `logUserid` = '$logUserid' AND `train_id` = '$train_id' AND `train_start_station` = '$train_start_station' AND `date` = '$train_date' AND `arrival` = '$train_arrival' ";
$sql6="SELECT * FROM select_seat WHERE `train_id` = '$train_id' AND `date` = '$train_date' AND `arrival` = '$train_arrival' AND `row` = '$i' AND `seat` = '$best_line'";
$sql8="SELECT * FROM select_seat_temp WHERE `logUserid` = '$logUserid' AND `train_id` = '$train_id' AND `train_start_station` = '$train_start_station' AND `date` = '$train_date' AND `arrival` = '$train_arrival' ";
$sql9="DELETE FROM `best_seat` WHERE `logUserid` = '$logUserid' AND `train_id` = '$train_id' AND `train_start_station` = '$train_start_station' AND `date` = '$train_date' AND `arrival` = '$train_arrival' ";
$sql3="SELECT * FROM select_seat_temp WHERE `logUserid` = '$logUserid' AND `train_id` = '$train_id' AND `train_start_station` = '$train_start_station' AND `date` = '$train_date' AND `arrival` = '$train_arrival' AND `row` = '$r' AND `seat` = '$i'";
$sql4="SELECT * FROM select_seat WHERE `train_id` = '$train_id' AND `date` = '$train_date' AND `arrival` = '$train_arrival' AND `row` = '$r' AND `seat` = '$i'";
$sql3="SELECT * FROM select_seat_temp WHERE `logUserid` = '$logUserid' AND `train_id` = '$train_id' AND `train_start_station` = '$train_start_station' AND `date` = '$train_date' AND `arrival` = '$train_arrival' AND `row` = '$r' AND `seat` = '$i'";
$sql4="SELECT * FROM select_seat WHERE `train_id` = '$train_id' AND `date` = '$train_date' AND `arrival` = '$train_arrival' AND `row` = '$r' AND `seat` = '$i'";
$sql3="SELECT * FROM select_seat_temp WHERE `logUserid` = '$logUserid' AND `train_id` = '$train_id' AND `train_start_station` = '$train_start_station' AND `date` = '$train_date' AND `arrival` = '$train_arrival' AND `row` = '$r' AND `seat` = '$i'";
$sql4="SELECT * FROM select_seat WHERE `train_id` = '$train_id' AND `date` = '$train_date' AND `arrival` = '$train_arrival' AND `row` = '$r' AND `seat` = '$i'";
$sql3="SELECT * FROM select_seat_temp WHERE `logUserid` = '$logUserid' AND `train_id` = '$train_id' AND `train_start_station` = '$train_start_station' AND `date` = '$train_date' AND `arrival` = '$train_arrival' AND `row` = '$r' AND `seat` = '$i'";
$sql4="SELECT * FROM select_seat WHERE `train_id` = '$train_id' AND `date` = '$train_date' AND `arrival` = '$train_arrival' AND `row` = '$r' AND `seat` = '$i'";
$train_arrival=$row2['train_arrival'];//Arrival Time
$train_date=$row2['train_date'];// Train Date
$sql1="SELECT * FROM select_seat_temp WHERE `logUserid` = '$logUserid' AND `train_id` = '$train_id' AND `train_start_station` = '$train_start_station' AND `row` = '$row' AND `seat` = '$seat' ";
$sql3="DELETE FROM `select_seat_temp` WHERE `logUserid` = '$logUserid' AND `train_id` = '$train_id' AND `train_start_station` = '$train_start_station' AND `row` = '$row' AND `seat` = '$seat' ";
$train_arrival=$row2['train_arrival'];//Arrival Time
$train_date=$row2['train_date'];// Train Date
$sql1="SELECT * FROM select_seat_temp WHERE `logUserid` = '$logUserid' AND `train_id` = '$train_id' AND `train_start_station` = '$train_start_station' AND `date` = '$train_date' AND `arrival` = '$train_arrival' AND `row` = '$row' AND `seat` = '$seat' ";
$sql3="DELETE FROM `select_seat_temp` WHERE `logUserid` = '$logUserid' AND `train_id` = '$train_id' AND `train_start_station` = '$train_start_station' AND `date` = '$train_date' AND `arrival` = '$train_arrival' AND `row` = '$row' AND `seat` = '$seat' ";