[eluser]rogierb[/eluser]
Dude, you really need to learn MySQL, since this is very basic stuff:-)
<code>
select ta.id, t.id, t.name from master_table t
left join master_table ta on (t.mid = ta.id)
where t.id = ‘category_id’
</code>
"t" and "ta" are dummy names (aliases) that represent the corresponding table. if it says " tablename abc" then "abc.id" is the same as "tablename.id". Which is ofcourse the id from table "tablename"
What I've done if join the table with itself, so if your table is called "my_table" then both "t" and "ta" represent that table. joining is nothing more then saying that if 2 tables have something common, use that thing they have in common as a selector for the table that is joined.(more or less)
Just read up upon joins on mysql.com and you'll get it fast enough