i have two table. Records and Villas
Records table:
ID, VID (Villa ID), NAME, PRICE
Villas table:
ID, NAME (Villa NAME), PHOTOS etc.
I using this SQL:
SELECT records.id, villa_name AS (SELECT name FROM villas WHERE id = records.vid), records.name
FROM records WHERE records.id = 5
What is wrong ?
You should use JOIN here.