How to select two additional columns from another table based on id in the main table?
SELECT t1.*, t2.*
FROM tbl_setup t1, tbl_specialty t2
WHERE t1.app_id = 12
How to select two additional columns from another table based on id in the main table?
SELECT t1.*, t2.*
FROM tbl_setup t1, tbl_specialty t2
WHERE t1.app_id = 12
Use a JOIN:
SELECT * FROM tbl_setup t1
JOIN tbl_speciality t2
ON t1.app_idd = t2.t1_app_id
I am not sure, but I don't think you can use "$" in a MySQL column name without running into problems later.
A nice explanation of MySQL Joins:
http://blog.codinghorror.com/a-visual-explanation-of-sql-joins/