Using two Tables to show SQL data on one Screen
<p>I am still battelling to show data from two different tables on one screen. The tables both contain one common field name, all i want is to filter on that field name and be able to alter and display details from that line or lines based on that field name they share. </p>

<p>The two tables are:</p>

<p>members and recipients</p>

<p>In members it has a primary key member_id and it is unique. Then in recipients I created a member_id field that needs to link to the members table unique member_id as well. </p>

<p>The following code calls information from members table</p>

<pre><code>&lt;?php
$con = mysql_connect("localhost", "****", "****");
if (!$con) {
    die('Could not connect: ' . mysql_error());
}

mysql_select_db("stingin_epanic", $con);

$result = mysql_query("SELECT * FROM members WHERE member_msisdn='$slusername'");
echo "&lt;table border='1'&gt;
    &lt;tr&gt;
    &lt;th&gt;Membership&lt;/th&gt;
    &lt;th&gt;Number&lt;/th&gt;
    &lt;th&gt;Registration Date&lt;/th&gt;
    &lt;th&gt;End Date&lt;/th&gt;
    &lt;th&gt;Copy of ID&lt;/th&gt;
    &lt;/tr&gt;";
while ($row = mysql_fetch_array($result)) {
    echo "&lt;td&gt;&lt;center&gt;" . $row['member_id'] . "&lt;/td&gt;";
    echo "&lt;td&gt;&lt;font color=blue&gt;" . $row['member_msisdn'] . "&lt;/td&gt;";
    echo "&lt;td&gt;&lt;center&gt;" . $row['asdate'] . "&lt;/td&gt;";
    echo "&lt;td&gt;&lt;center&gt;" . $row['aedate'] . "&lt;/td&gt;";
    echo "&lt;td&gt;&lt;center&gt;" . $row['attid'] . "&lt;/td&gt;";
    echo "&lt;/tr&gt;";
}

echo "&lt;/table&gt;";

mysql_close($con);
?&gt;
</code></pre>

<p>This works great and gives me what i need. I am also calling member_id here to show the primary key.</p>

<p>On same page i am trying to call information related to the member from another table using the following code. Note that the information is supposed to be linked to the member_id of the first code</p>

<pre><code>&lt;?php
$con = mysql_connect("localhost", "****", "****");
if (!$con) {
    die('Could not connect: ' . mysql_error());
}

mysql_select_db("stingin_epanic", $con);

$result = mysql_query("SELECT * FROM members a INNER JOIN recipients b ON member_id = member_id WHERE member_msisdn=$slusername");
echo "&lt;table border='1'&gt;
    &lt;tr&gt;
    &lt;th&gt;Name&lt;/th&gt;
    &lt;th&gt;Number&lt;/th&gt;
    &lt;/tr&gt;";

while ($row = mysql_fetch_array($result)) {
    echo "&lt;td&gt;&lt;font color=blue&gt;" . $row['recipient_name'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['recipient_msisdn'] . "&lt;/td&gt;";
    echo "&lt;/tr&gt;";

    echo "&lt;td&gt;&lt;font color=blue&gt;" . $row['recipient_name'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['recipient_msisdn'] . "&lt;/td&gt;";
    echo "&lt;/tr&gt;";
}

echo "&lt;/table&gt;";

mysql_close($con);
?&gt;
</code></pre>

<p>Using the second code i get no results as it is calling no information</p>
