テキストボックスの値として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>
うまくいけば、これは私が探しているものを説明するのに十分です.