<?php
$dbh=mysql_connect ("localhost", "equestra_test", "password") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("equestra_members");
$username = $HTTP_POST_VARSї'txtName'];
$password = $HTTP_POST_VARSї'txtPassword'];
$rs = mysql_query("SELECT * FROM myUsers WHERE Name = '$username' AND Password = '$password' ");
//if the user exists
if (mysql_num_rows($rs)>0)
{
echo("The user already exists, please try again");
}
else
{
//the user does not exist set him into the user table
$sql = mysql_query("INSERT INTO myUsers VALUES ( '$username', '$password' ) ");
echo("You have registered");
} ?>
That's my code!!! but i'm confused... ok i have the database, and the table... but the information that is entered does not save to the table.. am i missing something?
The "myUsers (username, password) VALUES..." part is I think what you need. username is the title for the column where usernames are stored, password is the title for the column where passwords are stored.