PHP SQL Query 2 Tables
<p>I need to query the database with a php query.</p>

<p>I need to get the id that matches $somevalue and the with that ID query table 2 so I can get a field value contained in that row where the id is found.</p>

<pre><code>$somevalue = '123';


Select id from table1 where $somevalue = id

...so we have the ID ... now we query table 2

select id, field2 from table2 where id = $id

echo $id;
echo $field2
</code></pre>

<p>How can I do this in a php query?</p>
