Well, you altered your getTitles() function from your original posting, you now reference the ID as well as the title.
So now you will need to explicitly select ID, Title from the table.
If you have not understood this fundamental premise then you really need to go and read some tutorials on the basics of SQL, you should do that next.
mysql_query("SELECT `ID`, `Title` FROM posts ORDER BY `ID` DESC");
Any decent tutorial will also cover how to make a JOIN, where you join data from two tables, and then select what you want from that join.