Hi all, I have only ever done basic (and I mean very basic) coding and am now stuck already. I am following this guide - http://www.scribd.com/doc/128662/Create-dynamic-sites-with-PHP-MySQL
to assist me in uderstanding how PHP and SQL work together.
This is my code so far:
$db = mysql_connect("localhost", "root","pass");
$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";
<form method="post" action="input.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>
When I click "Submit", the "Thank you! Information entered" message does not appear and the DB is not updated.
By the way, my register_globals is set to off which is why I have added the $_POST lines above. I'm sure you guys already knew that but I thought I should add it just in case I have done something wrong.