Can you please tell me the concept of the module. We need to make the bus route search module. There is a field of departure and destination point. When typing in the field when typing the first letters displays all possible cities. What can this feature be done with?

    1 answer 1

    For example:

    Route table: id, number num, name name etc

    Table of stops: id, route mid, name name, city city [, x / y coordinates] etc

    Well, respectively, on request we are looking for a route in which there is a starting and ending point, something like

    SELECT m.* FROM marshrut as m JOIN points as p1 ON p1.mid = m.id JOIN points as p2 ON p2.mid = m.id WHERE p1.city = 'Moscow' AND p2.city = 'NewYork' ; 

    The choice of the city according to the first letters is banal, google) Yes, at least Google’s google hint algorithm))

     // Спойлер: ... WHERE city LIKE 'Mos%'; 
    • Thank you very much ... Well, I basically suspected that this was necessary. The entire route table in the excel book (sheets: suburb, long-distance, etc.). it can be considered a component of phpexcel in Mysql database campaign))) - DMITO