Textfeld-Inhalt in Tabelle einfügen
|
Mittels INSERT-Anweisung lassen sich TEXTFELD-Daten in eine Tabelle einfügen. |
<html>
<head>
</head>
<body>
<form method=post action=inserttextfeld.php>
<input type=text size=20 name=name>
<input type=submit>
</form>
<?php
$servername = "yourservername";
$username = "yourusername";
$password = "yourpassword";
$dbname = "yourdbname";
$name=$_POST['name'];
$con = mysqli_connect($servername,$username,$password,$dbname);
$res = mysqli_query($con, "INSERT INTO data (name) VALUES ('$name')");
$num = mysqli_num_rows($res);
mysqli_close($con);
?>
</body>
</html>
|