我迷路了。我想要做的是,我希望我的网站允许用户在我的数据库中选择某一行(记录),然后将他们重定向到另一个网页,该网页将向他们显示有关该特定记录的完整信息。我不知道如何使用动态表格/文本将这两个网页连接在一起。下面是我的代码的一部分:(这是第一个网页:)
mysql_select_db($database_rfq_portal, $rfq_portal);
$query_rfqrecord = "SELECT tblrfq.`RFQ_ID`, tblrfq.`Company_Name`, tblrfq.Service,
tblrfq.`Kind_of_Request`, tblrfq.Status, tblrfq.`Date` FROM tblrfq";
$rfqrecord = mysql_query($query_rfqrecord, $rfq_portal) or die(mysql_error());
$row_rfqrecord = mysql_fetch_assoc($rfqrecord);
$totalRows_rfqrecord = mysql_num_rows($rfqrecord);
<form id="viewform" name="viewform" method="get" action="ViewSpecificRFQ.php">
<table width="716" border="1" align="center" cellpadding="5">
<tr>
<td>RFQ ID</td>
<td>Company Name</td>
<td>Service</td>
<td>Kind of Request</td>
<td>Status</td>
<td>Date</td>
</tr>
<?php do { ?>
<tr>
<td><a href="ViewSpecificRFQ.phpRFQID=<?php echo $row_rfqrecord['RFQ_ID'];?>"><?php echo $row_rfqrecord['RFQ_ID']; ?></a></td>
<td><a href="ViewSpecificRFQ.phpRFQID=<?php echo $row_rfqrecord['RFQ_ID'];?>"><?php echo $row_rfqrecord['Company_Name']; ?></a></td>
<td><a href="ViewSpecificRFQ.phpRFQID=<?php echo $row_rfqrecord['RFQ_ID'];?>"><?php echo $row_rfqrecord['Service']; ?></a></td>
<td><a href="ViewSpecificRFQ.phpRFQID=<?php echo $row_rfqrecord['RFQ_ID'];?>"><?php echo $row_rfqrecord['Kind_of_Request']; ?></a></td>
<td><a href="ViewSpecificRFQ.phpRFQID=<?php echo $row_rfqrecord['RFQ_ID'];?>"><?php echo $row_rfqrecord['Status']; ?></a></td>
<td><a href="ViewSpecificRFQ.phpRFQID=<?php echo $row_rfqrecord['RFQ_ID'];?>"><?php echo $row_rfqrecord['Date']; ?></a></td>
</tr>
<?php } while ($row_rfqrecord = mysql_fetch_assoc($rfqrecord)); ?>
</table>
}
</form>
这是将获得表单的网页..(我的代码的一部分)
$RFQID = $_GET['RFQ_ID'];
mysql_select_db($database_rfq_portal, $rfq_portal);
$query_rfqrecord = "SELECT * FROM tblrfq WHERE $RFQID";
$rfqrecord = mysql_query($query_rfqrecord, $rfq_portal) or die(mysql_error());
$row_rfqrecord = mysql_fetch_assoc($rfqrecord);
$totalRows_rfqrecord = mysql_num_rows($rfqrecord);
mysql_select_db($database_rfq_portal, $rfq_portal);
$query_user = "SELECT tbluser.Username, tbluser.Password FROM tbluser";
$user = mysql_query($query_user, $rfq_portal) or die(mysql_error());
$row_user = mysql_fetch_assoc($user);
$totalRows_user = mysql_num_rows($user);
<table width="716" border="0" align="center">
<tr>
<th colspan="2" scope="row">RFQ ID:</th>
<td><?php echo $row_rfqrecord['RFQ_ID']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Company Name:</th>
<td width="511"><?php echo $row_rfqrecord['Company_Name']; ?></td>
</tr>
<tr>
<th width="101" rowspan="2" scope="row">Address:</th>
<th width="90" scope="row">Site A:</th>
<td><?php echo $row_rfqrecord['Address_A']; ?></td>
</tr>
<tr>
<th scope="row">Site B:</th>
<td><?php echo $row_rfqrecord['Address_B']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Contact Number:</th>
<td><?php echo $row_rfqrecord['Contact_Number']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Contact Person:</th>
<td><?php echo $row_rfqrecord['Contact_Person']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Service:</th>
<td><?php echo $row_rfqrecord['Service']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Bandwidth:</th>
<td><?php echo $row_rfqrecord['Bandwidth']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Telco:</th>
<td><?php echo $row_rfqrecord['Telco']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Account Manager:</th>
<td><?php echo $row_rfqrecord['Account_Manager']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Status:</th>
<td><?php echo $row_rfqrecord['Status']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Kind of Request:</th>
<td><?php echo $row_rfqrecord['Kind_of_Request']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Date:</th>
<td><?php echo $row_rfqrecord['Date']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Remarks:</th>
<td><?php echo $row_rfqrecord['Remarks']; ?></td>
</tr>
</table>
</form>
这会将用户重定向到下一页,但我的问题是它一直显示相同的记录,这是我数据库中的第一条记录。