Hello , ive been trying to create a register form that is validated then will add a user to a MySQL database so they can login to a site. The validation code works but it dosent seem to be adding the INSERT query to teh database im sure its a stupid mistake on my part but I cant see the woods for teh trees on this. Any help you could give would be great.
If ($valid ==1) {
$db = mysql_connect($dadd,$dusr,$dpwd) or die("Could not connect... ");
mysql_select_db($dname,$db);
$query = "INSERT INTO usertable VALUES ($firstname, $lastname, $address, $usrname,$passwd)";
mysql_query($query);
echo "You are now a Registered User";
//echo "<a href="login.html"> info </a>";
echo($usrname);
echo($query);
} else {
echo "invalid details";
echo($usrname);
}