I have a one to many relationship and the tables in my database are as follows:
+---------------+ +-------------+
| Route | | Street |
+---------------+ +-------------+
|route_id | |st_id |
|route_name | |street_name |
|street_ids: | +-------------+
|(st_1, st_2, |
|st_3, st_n) |
+---------------+
In my Route table I stored the Street's st_id as string is it was saved with the street_name being checked in a form.
I want to display all the Streets included in a Route. I used explode function in PHP to get the st_ids from Route table. How can get the street_names from the Street table using the array result of the previous explode function?
In case my practice of storing the list of ids as string in a table is bad, I'll be open for suggestions.
Thanks.