Question about joining two mysql tables
I am trying to join two tables; the purpose of which is to be able to search and display information about the event for the artist, which is entered by the user.
The tables look like this:
artist table: [ID], [name]
event table: [ID], [artist_id], [venue_name], [city], [state], [date] [time]
I created a search engine, but what I want to do is when an artist name is entered into the textbox, the code will go out to my database and look at the artist table to see what name was entered, then grab the id that matches the entered name and then go to the events table to find that individual artist_id file and display all the event information for a specific artist that was entered.
I'd love to help how to do this, and I'm not the best of them, but I'm trying! Thanks:)
a source to share
select a.name, e.*
from artist as a
left join events on(a.id - e.artist_id)
where a.name like '%$someinput%'
just in case you don't want to find an exact name match.
Just trying to help. and he is sure that I am not very good at this, but I want to help, since at first it is too difficult for me.
a source to share