Hej
Jeg har en database "learndb", som jeg gerne vil fylde op via en formel.
Hvorfor kommer der ingen data i tabellen?
<html>
<?php
if($submit)
{
$db = mysql_connect("localhost", "root", "");
mysql_select_db("learndb",$db);
$sql = "insert into personnel (firstname, lastname, nick, email, salary)
values ('$first','$last','$nickname','$email','$salary')";
$result = mysql_query($sql);
echo "Tak for det. \n";
}
else
{
?>
<form method="post" action="datain2.php">
First name:<input type="Text" name="first"><br>
Last name:<input tupe="Text" name="last"><br>
Nick name:<input type="Text" name="nickname"><br>
E-mail:<input type="Text" name="email"><br>
Salary:<input type="Text" name="salary"><br>
<input type="submit" name="submit" value="Enter information">
</form>
<?
}
?>
</html>
Mvh
Anders
|