MySQL从其他表中的ids中选择歌曲

How can i select all the id's from a table, and let select all the songs with the id;s from the other table?

$query = "SELECT * FROM songs WHERE id = (SELECT songid FROM top10 order by id)'";

You can use IN for that (or EXISTS):

select * 
from songs
where id in (
    select songid 
    from top10 )

Based on your comments, you might actually be looking to use JOIN (just realize if there are duplicate records in the top10 table, this could return duplicate results):

select s.* 
from songs s
 join top10 t on s.id = t.songid
order by t.id