嗨我輸入數據庫中的4條記錄,一切都很好,我通過表格輸入的記錄被成功添加到數據庫,但是當我瀏覽表中有4條記錄可用,但記錄的內容缺少,請幫助。謝謝。在phpmyadmin coulmns中缺少數據
代碼
<body>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "test";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO names (firstname, secondname) VALUES ('', '')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
<?php echo $_POST["firstname"]; ?><br />
<?php echo $_POST["secondname"]; ?>
</body>
</html>
Sceenshot
可以請您詳細描述一下嗎? –
您需要向我們展示一些代碼,以便我們能夠幫助您 – Epodax
發佈您的代碼(嘗試過) – Karthi