我需要将 php 页面上的回显添加到我在同一页面上创建的表中,以将其交叉插入到不同的 SQL DB
以下是我的代码
<?php
$con = mysql_connect("localhost","****","****");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("****", $con);
$result = mysql_query("SELECT * FROM members
WHERE member_msisdn='$slusername'");
echo "<table border='1'>
<tr>
<th>Membership</th>
<th>Number</th>
<th>Registration Date</th>
<th>End Date</th>
<th>Copy of ID</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<td><center>" . $row['member_id'] . "</td>";
echo "<td><font color=blue>" . $row['member_msisdn'] . "</td>";
echo "<td><center>" . $row['asdate'] . "</td>";
echo "<td><center>" . $row['aedate'] . "</td>";
echo "<td><center>" . $row['attid'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?></div>
<div class="Notes"><strong><br>
Emergency Contact Numbers:</strong><br>
<?php
$con = mysql_connect("localhost","****","****");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("****", $con);
$result = mysql_query("SELECT * FROM members a INNER JOIN recipients b ON a.member_id =
b.member_id WHERE member_msisdn=$slusername");
echo "<table border='1'>
<tr>
<th>Number</th>
<th>Name</th>
<th>Surname</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<td><font color=blue>" . $row['recipient_msisdn'] . "</td>";
echo "<td>" . $row['recipient_name'] . "</td>";
echo "<td>" . $row['recipient_surname'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
</div>
<p>
<label for="member_id"></label>
<input type="text" name="member_id" id="member_id"> // here i need the
member_id of members to be printed so i can have it entered into another table on same
sql DB
</p>
<p><br>
</p>
</div></td>
基本上在顶部我回显了 member_id 但我需要将它自己输入到表 member_id 中,然后通过放置在 SQL DB 上的操作