PHP从一个表中获取id,并从另一个表中提取与这些id相对应的数据

I have this query:

$query = "SELECT *FROM wp_postmeta WHERE meta_key = '_isEvent' AND meta_value ='yes' ORDER BY post_id LIMIT 0, 5" or die(mysql_error()); 
    $result = mysql_query($query) or die(mysql_error());

    while ($row = mysql_fetch_array($result)) { 

        $eventid = $row ['post_id'];

    echo "<p>".$eventid."</p>";


    }

This currently posts some ids $eventid. I now want to run another query in another table (same database) that pulls some post titles that matches those id's.

Table is called "wp_posts" and column to match is "ID" and want to echo out post title from "post_title".

Where do I start?

Sounds like you want to use SQL joins. W3 schools has a good intro article about this. http://www.w3schools.com/sql/sql_join.asp

Something like the following

SELECT post_title FROM wp_postmeta m, wp_posts p WHERE m.wmeta_key = '_isEvent' AND m.meta_value ='yes' AND m.post_id == p.post_idORDER BY m.post_id LIMIT 0, 5