kiml Posted February 10, 2007 Share Posted February 10, 2007 Hey folks. I need help making a function to print up the nearest route comparing to current time. I have 3 values in my SQL that may be of your interest -> ID, deparure_time and departure_minuttes. They are saved like -> 236, 12, 21 I have allredy maked the basic in the code $Route = "SELECT * FROM Ruter WHERE DepartureID = '$Neste_flyvning_dep' AND ArrivalID = '$Neste_flyvning_arr' AND FlyType = '$Flytype_pilot' LIMIT 1"; $Rtr = mysql_query($Route) or die ("Cant run logg". mysql_error()); while ($FlightnrQ = mysql_fetch_array($Rtr)) { Print "<b>$FlightnrQ[RuteNr]</b> - Departure $FlightnrQ[departure_time]:$FlightnrQ[departure_minutt]<br>"; } But I need some help to view only the next route. Somebody who know how to do this stuff? Quote Link to comment Share on other sites More sharing options...
only one Posted February 10, 2007 Share Posted February 10, 2007 can you explain what you mean by route? Quote Link to comment Share on other sites More sharing options...
only one Posted February 10, 2007 Share Posted February 10, 2007 i think i know what your doing, you making like a traveling thing Quote Link to comment Share on other sites More sharing options...
only one Posted February 10, 2007 Share Posted February 10, 2007 thats gonna take alot of ifs, i cant think of any other way :-\ Quote Link to comment Share on other sites More sharing options...
kiml Posted February 10, 2007 Author Share Posted February 10, 2007 Yes, it will be a little traveling thing, I can print all routes but I want only the one which is nearest to departure at current time to be printed.. pretty hard to explain what I mean, but you got it? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.