
22-10-2004, 04:26 PM
|
|
Novice Webmaster
|
|
Join Date: Aug 2001
Posts: 11
Rep Power: 0
|
|
My First PHP didn't work!
File 1
<HTML>
<BODY>
<form method="post" action="datain.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>
File 2
<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>
Why the mysql didn't add row?
It that is becoz i am using phpdev for installing phpmyadmin & apache?
pls advise
|