こんにちは私は、このコードがhtmlテキストフィールドからのデータを実際のデータベースに挿入しない理由を理解していません。まず、First_Nameだけを使用してサンプリングしようとしています。
とにかくHTMLコードは次のとおりです:
<form action="Proform.php" name="Myform" method="post">
<input type ="hidden" value="1" name="check_submit" />
Please Enter First Name: <input type ="text" name="First_Name" /> <br />
Please Enter Second Name: <input type ="text" name="Second_Name" /><br />
Please Enter Email Address: <input type ="text" name="Email_Address" /><br />
Please Enter A Password: <input type="password" name="Password" /><br />
<input type ="submit" name"Submit" /><br />
</form>
そして、phpとMYSQLは次のとおりです:
<?php
$dbname='ecig';
$dbhost='localhost';
$dbpass='password';
$dbuser='eciguser';
$dbhandle = mysql_connect($dbhost, $dbuser, $dbpass)
or die("Unable to connect to MySQL");
echo "Connected to MySQL<br>";
$selected = mysql_select_db("ecig",$dbhandle)
or die("Could not select examples");
$res=mysql_query("INSERT INTO Persons (First_Name, Second_Name) VALUES ('$_POST[First_Name]')");
if (array_key_exists ('check_submit', $_POST ))
echo "Your Name is : {$_POST['First_Name']}<br />";
echo "Your Second Name is : {$_POST['Second_Name']}<br />";
echo "Your Email Address is : {$_POST['Email_Address']}<br />";
echo "Your Password Is : {$_POST['Password']}<br />";
?>
このコード行と関係があるはずですが、私はそれを見つけることができません。あなたの誰かが何が悪いのかを見つけることができますか?
$res=mysql_query("INSERT INTO Persons (First_Name, Second_Name) VALUES ('$_POST[First_Name]')");
どんな助けでも大歓迎です。ありがとう 。