Jump to content

AMITKUMAR

Members
  • Posts

    14
  • Joined

  • Last visited

AMITKUMAR's Achievements

Member

Member (2/5)

0

Reputation

  1. Nothing happen. is code working on your Localhost i am using XAMPP 5.6.3 [php: 7.0.3] XAMPP CP V3.2.2 Compiled Nov 12th 2015 also tested on XAMPP Version 5.6.20
  2. Jquery doesn't calling routes_2.php debugger sowing routes_1.php only.
  3. I dont know why but after all error settled up its showing nothing on page also not updating database.
  4. Great sir ! i am pleased that you get a topic to learn because of me btw i am getting a error while executing the Routes_1.php file " Fatal error: Call to a member function fetch_row() on boolean in C:\xampp\htdocs\yatrika\route1.php on line 13 " From where you are calling a Fetch Row Function ?
  5. sir you suggested to show route on Map but i want to retrieve route information from Map so that all things like speed and distance of intermediate will come automatically only i have to feed stops and press ADD, if i do much calculation then all my time will be going to be wasted on adding Database,
  6. I am designing a Website of searching Buses stops and its timings i want to clear some concepts about how can i integrate Google Maps with my Database in PHP so that when i add some stops it will render from Google Maps and create a route pattern accordingly and saves to Database finally. for more clarity i have added a Pic only just need to clear concept i don't want coding's i will do it myself.
  7. I have station_id = '$stationId1' = DURG station_id = '$stationId2' = KHARAGPUR Search result showing = 12869 CST HWH Weekly, DURG -> KHARAGPUR 5:25 -16:50 but another train was not showing which is 12101 Jananeshwari on DB? When i feed: stationid1 = BHOPAL stationid2= DURG Search result showing = 12853 AMARKANTAK EXPRESS, DURG -> BHOPAL 18:20 -10:30 but quit shocking why not showing 12854 which is correct train instead of above also residing in db?
  8. Actually sir PHP is not in my Course i have myself choosen this subject because i want to continue this project as commercial after successful graduation. so doing as scratch which am gathering from inet
  9. as you told sir, am pasting all my code which i used in : <?php function stationIdToName($stationId) { @$query1=mysql_query("SELECT * FROM entry_ir_station WHERE id = '$stationId' LIMIT 1"); while($row1=mysql_fetch_array($query1)) { @$stationName = $row1['station_name']; } return $stationName; } function trainIdToName($trainId) { @$query1=mysql_query("SELECT * FROM entry_ir_train WHERE id = '$trainId' LIMIT 1"); while($row1=mysql_fetch_array($query1)) { @$trainName = $row1['train_name']; } return $trainName; } function trainIdToCode($trainId) { @$query1=mysql_query("SELECT * FROM entry_ir_train WHERE id = '$trainId' LIMIT 1"); while($row1=mysql_fetch_array($query1)) { @$trainCode = $row1['train_code']; } return $trainCode; } function dayIdToName($dayId) { if($dayId=='0'){return 'SUNDAY';} if($dayId=='1'){return 'MONDAY';} if($dayId=='2'){return 'TUESDAY';} if($dayId=='3'){return 'WEDNESDAY';} if($dayId=='4'){return 'THRUSDAY';} if($dayId=='5'){return 'FRIDAY';} if($dayId=='6'){return 'SATURDAY';} if($dayId=='7'){return 'DAILY';} if($dayId=='1,2,5,6'){return 'M, TU, F, S';} if($dayId=='2,3,5,6'){return 'TU, W, F, S';} if($dayId=='2,3,6,0'){return 'TU, W, S, SU';} if($dayId=='1,0,4,3'){return 'SU, M, W, TH';} } ?> <?php @$query1A=mysql_query("SELECT * FROM entry_ir_station WHERE station_name ='$station_from'"); @$count1= mysql_num_rows($query1A); @$query1B=mysql_query("SELECT * FROM entry_ir_station WHERE station_name = '$station_to'"); @$count2= mysql_num_rows($query1B); if($count1 >='1' AND $count2 >='1') { @$query1C=mysql_query("SELECT * FROM entry_ir_station WHERE station_name = '$station_from'"); while($row1C=mysql_fetch_array($query1C)) { @$stationId1 = $row1C['id']; } @$query1D=mysql_query("SELECT * FROM entry_ir_station WHERE station_name = '$station_to'"); while($row1D=mysql_fetch_array($query1D)) { @$stationId2 = $row1D['id']; } // MAKE A LIST OF TRAINS CROSSING STATION FROM AND MAKE THE SAME FOR STATION TO // NOW COMPARE THESE TRAIN IDS, IF BOTH ARE SAME THEN TAT PARTICULAR TRAIN IS CROSSING BOTH STATIONS // NOW COMPARE THE TIMING IF TRAIN CROSSING STATION FROM IS LESS THAN STATION FOR // AND DAY STATION FROM IS EITHER LESS THAN OR EQUAL TO STATION TO, IF ALL THESE // THINGS MATCHES THEN PROCEED WITH THE DETAILS OF THAT TRAIN @$query1e=mysql_query("SELECT * FROM entry_ir_route WHERE station_id = '$stationId1' ORDER BY station_arrival_time ASC"); while($row1e=mysql_fetch_array($query1e)) { //echo 'loop 1'; @$train_id1 = $row1e['train_id']; @$station_id1 = $row1e['station_id']; @$line_id1= $row1e['line_id']; @$week_day1 = $row1e['week_day']; @$station_arrival_time1 = $row1e['station_arrival_time']; @$station_departure_time1 = $row1e['station_departure_time']; @$query1f=mysql_query("SELECT * FROM entry_ir_route WHERE station_id = '$stationId2' ORDER BY station_arrival_time ASC"); while($row1f=mysql_fetch_array($query1f)) { @$train_id2 = $row1f['train_id']; @$station_id2 = $row1f['station_id']; @$line_id2 = $row1f['line_id']; @$week_day2 = $row1f['week_day']; @$station_arrival_time2 = $row1f['station_arrival_time']; @$station_departure_time2 = $row1f['station_departure_time']; if($train_id1==$train_id2 AND ($station_arrival_time2 > $station_arrival_time1 AND $week_day1>=$week_day1) ) { // FETCH TRAIN DETAILS TIMING IN STATIONS STATION NAME ETC DATA @$query1o=mysql_query("SELECT * FROM entry_ir_route WHERE train_id = '$train_id1' AND week_day >= '$week_day1' AND week_day <= '$week_day2' AND station_arrival_time >= '$station_arrival_time1' AND station_arrival_time <= '$station_arrival_time2' AND ( station_id = '$stationId1' OR station_id = '$stationId2' ) "); while($row1o=mysql_fetch_array($query1o)) { @$this_train_id = $row1o['train_id']; @$this_station_id = $row1o['station_id']; @$this_line_id = $row1o['line_id']; @$this_week_day = $row1o['week_day']; @$this_station_time = $row1o['station_time']; @$this_station_arrival_time = $row1o['station_arrival_time']; @$this_station_departure_time = $row1o['station_departure_time']; @$thisTrainName = trainIdToName($this_train_id); @$thisTrainCode = trainIdToCode($this_train_id); @$thisStationName = stationIdToName($this_station_id); @$thisDayName = dayIdToName($this_week_day); //echo $this_train_id.'<br />'; ?> <section class="section"> <div class="col span_20"> <?php echo $thisTrainCode; ?></div> <div class="col span_20"><?php echo $thisTrainName; ?> </div> <div class="col span_20"><?php echo $thisStationName; ?> </div> <div class="col span_10"><?php echo $this_station_arrival_time; ?> </div> <div class="col span_10"><?php echo $this_station_departure_time; ?> </div> <div class="col span_20"><?php echo $thisDayName; ?> </div> </section> <?php } } } } ?> Sorry i have attested a TXT File because file uploader shown me error that i dont have permission to upload SQL file, just change extension is required from TXT to SQL. entry_ir_route.txt
  10. Thanks both of you sir! i really appreciate you motivated me i have made a query my self but am feeling to reached dead end here is my code: // FETCH TRAIN DETAILS TIMING IN STATIONS STATION NAME ETC DATA @$query1o=mysql_query("SELECT * FROM entry_ir_route WHERE train_id = '$train_id1' AND week_day >= '$week_day1' AND week_day <= '$week_day2' AND station_arrival_time >= '$station_arrival_time1' AND station_arrival_time <= '$station_arrival_time2' AND ( station_id = '$stationId1' OR station_id = '$stationId2' ) "); what am mistaking i don't know but it giving me wrong search results some times returns blank data even though trains have stoppages on that particular station .
  11. Exactly sir you what i mean to say you understand-ed but the thing is when hit search button how could i implement in search page so that any queries it will handle dynamically.
  12. I am making a Railway Search website for University Project and i want to implement advanced Search functionality but as i am new to this field i need help from you guys please help me to create that function here i am describing : I have 3 Database with relevant fields one is Station db one is Train db and third is train timetable Db, Trains i have added using Station ID with arrival departure timings. now how can i implement search code to get In-between all trains results which user queried for example we have 5 stations A B C D E, 3 train going to A to E one is without any stopping between A to E second is stopping only C and third is stopping all. if any one have queried about A to E then all 3 trains should be displayed, if A to C queried then 2 trains should be displayed and if A to D then only one train should be displayed. Please help me to sort out this search Thanks.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.