php – Internal join between two MYSQL tables

Hello!

I'm trying to do an internal join between two tables but I can not do it, I leave the tables and how I do it:

** Table1 **

IdTabla1
name

** Table2 **

Idtabla2
Idtabla1

SELECT table1.Name
FROM the table1
INNER JOIN table 2
ON table1.name = table2.idtable2;

I need to get the names of table 1 using table1 in table 2

Thank you so much!