First, there is no need (as far as I can tell) for two different sets of ID's (ID and aID). Consider the following:
Table: Actor_English
Columns:
ID
Name
Movie
etc
Table: Actor_Thai
Columns:
ID
Name
Movie
etc
Table: Actor_ID
Columns:
ID
This makes your life a lot simpler. To do the example search you mention, join the three tables together by matching the ID columns. In the resulting table, search for the actor's name (Brad Pitt) in the column corresponding to the language specified (English), and retrieve the entire matching entry, including the actor's Thai name.
The SQL for this would look like the following:
Code:
SELECT ID, E.Name, E.Movie, ..., T.Name, T.Movie, ...
FROM Actor_ID AS A
LEFT JOIN Actor_English AS E ON A.ID=E.ID
LEFT JOIN Actor_Thai AS T ON A.ID=E.ID
Note that this is a pretty advanced query, as it uses two LEFT JOIN's to ensure that entries will be included even for actors that don't have database entries for both languages. If you're not familiar with LEFT JOIN's, read Part 9 of my article series on PHP/MySQL for a complete discussion of their use.
Of course, the query would be much simpler if you just put all the data in a single table. Is there any particular reason you need to keep them separate?
I hope this helps, and let me know if you have any further questions!
Bookmarks