文本框中的mysql单元格


mysql cell in textbox

我希望在mysql数据库中有一个单元格作为文本框中的值。

我希望在文本框中有CustomerID为1的人员的FirstName列。

这是我的编码。

<html>
<head>
<title>Edit Customer</title>
</head>
<body>
<?php
mysql_connect("localhost","cmcclintock","000547") or die(mysql_error());
mysql_select_db("fleet hire motors") or die(mysql_error());
$CustomerID = $_GET["customerid"]; 
$query=mysql_query("SELECT FirstName FROM customer WHERE CustomerID = $CustomerID") or     die(mysql_error()); 
$row = mysql_fetch_array($query);

echo ($CustomerID);
echo ($query);
echo ($row);

?> 
<form name="custedit2" method=GET action="editcustomersubmit.php">
First Name: <input name="FirstName" type="text" value="<?php echo ($query); ?>">
<input name="submitbtn" type="submit" value="Save">
<input name="resubmitbtn" type="submit" value="Reset">
</form>
</body>
</html>

希望这足以说明我在寻找什么。

<input name="FirstName" type="text" value="<?php echo ($row['FirstName']); ?>">

$row是存储结果集的位置,因此您可以使用它来显示想要的列