I just started connecting PHP5 with mysql 5.0.0-alpha.
i had made a html file with the following code:
<HTML>
<BODY>
<form method="post" action="detain.php">
First name:<input type="Text" name="first"><br>
Last name:<input type="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>
Then i had coded the relavant detain.php with the following code:
<HTML>
<?php
$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 "Thank you! Information entered.\n";
?>
</HTML>
The problem i am facing is that no values are stored in the variables $first, $last, $nickname,$email,$salary and hence, a simple blank row is inserted in the database.
Can anybody help me in finding out why aren't the values from the form are automatically stored in the variables with the same name as of the fields?
Thanks,
Avneet