How fetch more than one result from the table and use them in query
<p>I have a problem with my code:</p>

<pre><code>&lt;?php 
    echo $s_country;
    $sql2="SELECT prod_id FROM tbl_order_item WHERE order_id='$order_id'";
    $res=mysql_query($sql2) or die(mysql_error());
    $i=0;
    $j="";
    while($rs=mysql_fetch_array($res)){
        $j = $rs['prod_id']; 
        if(trim($s_country)=='US' || trim($s_country=='United States' )){
            $sql3 = "SELECT shipping_us FROM tbl_product WHERE prod_id=".$j;
            $res=mysql_query($sql3) or die(mysql_error());
            $shipping_cost1=mysql_fetch_object($res);  
        }
        $i++;
    }
?&gt;
</code></pre>

<p>What I actually want to do is to fetch the products id from the table <code>tbl_order_item</code> and with that products id select the shipping cost for those ids from the table <code>tbl_product</code>.</p>

<p>For example, if there is two product ids, it should select shipping cost for both the ids.
But here it only works for one product id like this:</p>

<pre><code>SELECT shipping_us FROM tbl_product WHERE prod_id=526
</code></pre>

<p>But what I'm trying to do is :</p>

<pre><code>SELECT shipping_us FROM tbl_product WHERE prod_id=526
SELECT shipping_us FROM tbl_product WHERE prod_id=527
</code></pre>
