I am not 100% sure what you mean, but I'll try to help you. First, I hope that you got MySQL installed. Let's assume that you got a database called "mysite" with a table called "users" that contains two rows called "username" and "password". Both username and password is root.
index.php (The form)
<html>
<body>
<form method="post" action="submit.php">
Username:<input type="text" name="username"></input>
Password:<input type="password" name="password"></input>
</form>
</body>
</html> submit.php (The MySQL part)
<?php
mysql_connect("localhost","root","root"); //mysql_connect(host,username,password)
mysql_select_db("mysite"); //Select the database mysite.
$username=mysql_real_escape_string($_POST[username]); //mysql_real_escape_string protects you from sql injections that could "hack" your database.
$password=mysql_real_escape_string($_POST[password]); //if you name a input field password, it is avalible in the $_POST[password] variable
mysql_query("INSERT INTO users (username,password) VALUES('$username','$password')"); //The query that inserts everything to the database.
?>
OK!
I didn't test this code, please reply if you receive any errors(or even better, solve them!).
Hope it helps, and good luck!