mysql insert and form
Posted: Sat Jan 07, 2012 8:08 pm
Hi all,
i need advice for a simple Add code below that not work both mysql and form, please help
i need advice for a simple Add code below that not work both mysql and form, please help
Code: Select all
<form action="welcome.php" method="post">
Username: <input type="username" name="uname" />
Password: <input type="password" name="pwd" />
<input type="submit" value="Submit" />
</form>
<?php
$conn = mysql_connect("localhost","","");
if(!$conn)
{
die("Server not found".mysql_error());
}
mysql_select_db("mydatabase", $conn);
$sql = INSERT INTO tbl_login("uname", "pwd") VALUES ("uname", "pwd");
if(!mysql_query($sql, $conn));
{
die("error:".mysql_error());
}
echo "Thanks";
mysql_close($conn)
?>
