我創建了一個代碼來查看數據。數據不能在表單顯示...爲什麼數據無法在表單中顯示?
代碼:表單
<?php //======================================================================================================================= PROCESS DATA ======================================================= START.
include "connectioncomplaint.php";
?>
<?php
$subject = $_GET['type'];
$comment = $_GET['id'];
//echo 'test : ' . $name;
//Tarik data dari sini
$queryDetail = " SELECT * FROM campuscomplaint " . " WHERE subject = '" . $subject . "' AND comment = '" . $comment . "' ";
//echo 'QUERY DETAIL :' . $queryDetail . '<br>' ;
$resultDetail = mysql_query($queryDetail);
//echo 'RESULT DETAIL :' . $resultDetail + 0 . '<br>' ;
$detail = mysql_fetch_array($resultDetail);
//echo $detail . '<br>';
//echo 'detail subject is : ' . $detail['subject'] . '<br>';
//echo 'detail comment is : ' . $detail['comment'] . '<br>';
//echo $detail[$x] . '<br>';
?>
代碼:
<tr>
<td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5">From:</td>
<td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5"><input type="text" name="to"
size="40" maxlength="80" value="<?php echo $detail['userid']; ?>"/></td>
</tr>
<tr>
<td width="38%" bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5">Subject:</td>
<td width="62%" bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5"><input type="text" name="subject" size="40" maxlength="80" value="<?php echo $detail['subject']; ?>"/></td>
</tr>
<tr>
<td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5">Comment:</td>
<td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5"><textarea name="comment" rows="5" cols="40"><?php echo $detail['message']; ?></textarea></td>
</tr>
<tr>
<td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5"><p> </p>
<p> </p></td>
<td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="register style5"><input type="submit" name="submit" value="Submit Comment" onClick="return OnButton1();"/></td>
</tr>
也許這只是在發佈,但你也有一個錯字,你命名變量'$ resulDetail',然後傳入'$ resultDetail'(注意丟失的't '在第一種情況) – 2010-03-18 21:12:22
謝謝...但仍然錯誤.. – shimaTun 2010-03-18 21:20:54
你好鮑比表(http://bobby-tables.com/) – Quentin 2010-03-18 21:28:41