Given the form where I select the station (start) and station (end), and it should give all the stops that are in the posmi table, only the station name should be instead of id
There is a stac table with the following cells.
there is a table posmi
And simple form
And when I choose, for example, Tornakalns and Zasulauks, I would get the following:
2 Tornakalns - Zasulauks 3 Zasulauks - Tornakalns Here is my under-request:
select s.stacija, p.id, p.sakstacid, p.beigstacid from posmi as p right join stac as s on p.sakstacid = s.id RIGHT JOIN stac as st ON p.beigstacid=st.id where p.sakstacid in ("'.$_POST['from_place'].'", "'.$_POST['for_place'].'") and p.beigstacid in ("'.$_POST['for_place'].'", "'.$_POST['from_place'].'") 

