我需要查询数据库,然后用结果填充文本框输入。
我正在努力
致电日期:
<td>
<?php
$selectedSPK=$_POST['SPKSelect'];
$assigned = $_POST['Sales_Exec'];
$date = $_POST['DateSelect'];
if ($selectedSPK)
{
$Call1query = "SELECT Call1 FROM Data WHERE SPKCustNo = '$selectedSPK' ";
$Call1result = mysql_query($Call1query);
while( $row = mysql_fetch_array($Call1result) ){
$Call1 = $row["$Call1Result"];
}
}
?>
<input type="text" name="Call1" id="Call1" value="<?php echo( htmlspecialchars( $Call1) ); ?>"/></td>
但是一无所获,我要去哪里错了,填充文本输入似乎很棘手!
谢谢!
最佳答案
更换
$Call1 = $row["$Call1"];
与
$Call1 = $row["Call1"];