Hallo der gibt mir den error
es geht mit dem INsert into accounts nicht? IN die db wird nix geschrieben?
PHP
<html>
<form action = "reg.php" method = "post">
<p>Name <input type = "Namen" name="Name" /></p>
<p>Passwort <input type = "Pass" name="pw" /></p>
<p><input type = "submit" />
<input type = "reset" /></p>
</form>
<body>
<?php
$con = new mysqli("localhost","****","****");
mysqli_select_db($con,"accounts");
if(isset($_POST["Name"]) && isset($_POST["pw"]))
{
$con->query("INSERT INTO accounts (Name, Passwort) VALUES (" . $con->real_escape_string($_POST["Name"]) . "," . $con->real_escape_string($_POST["pw"]) . ")");
}
else
{
echo "Alles ausfüllen!";
}
?>
</body>
</html>
Alles anzeigen