PHP and MYSQL entering data
<p>What i am trying do do is echo data from sql to a php page this is the code i use.</p>

<pre><code>$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;";
</code></pre>

<p>The member_id is the primary field in this table and is assigned on another php page. </p>

<p>What i need to do next on this pages is enter data into another sql table but i need the code to automatically enter the member_id it echo'd into that table </p>

<p>The code I use to enter the info is as follow;</p>

<pre><code>&lt;?php
$host="localhost"; // Host name 
$username="****"; // Mysql username 
$password="****"; // Mysql password 
$db_name="****"; // Database name 
$tbl_name="****"; // Table name 

// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
mysql_select_db("$db_name")or die("cannot select DB");

$sql="SELECT * FROM $tbl_name WHERE member_msisdn='$slusername'";
$result=mysql_query($sql);
?&gt;
    &lt;tr&gt;
    &lt;form name="form1" method="post" action="inlbs_2.php"&gt;
      &lt;table width="646" border="1"&gt;
        &lt;tr&gt;
          &lt;td colspan="6"&gt;&lt;div align="center"&gt;&lt;strong&gt;Personal Details Main Member&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td width="82"&gt;Name:&lt;/td&gt;
          &lt;td colspan="2"&gt;&lt;label for="member_name"&gt;&lt;/label&gt;
            &lt;input type="text" name="member_name" id="member_name"&gt;&lt;/td&gt;
          &lt;td width="80"&gt;Surname:&lt;/td&gt;
          &lt;td colspan="2"&gt;&lt;label for="member_surname"&gt;&lt;/label&gt;
            &lt;input type="text" name="member_surname" id="member_surname"&gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;MSISDN Number:&lt;/td&gt;
          &lt;td colspan="2"&gt;&lt;label for="member_msisdn"&gt;&lt;/label&gt;
            &lt;input type="text" name="member_msisdn" id="member_msisdn"&gt;&lt;/td&gt;
          &lt;td&gt;Member ID:&lt;/td&gt;
          &lt;td colspan="2"&gt;&lt;label for="member_id"&gt;&lt;/label&gt;
            &lt;input type="text" name="member_id" id="member_id"&gt;&lt;/td&gt;
          &lt;/tr&gt;
</code></pre>

<p>Is there away that i can have the member_id automatically completed by php coding and if so how. The action php code should be the same as all my others if only i can have php call member_id in automatically</p>
