Hey guys I know that this is probably just a simple sql statement but I can not figure out the problem. It adds the user to the database but it will not add the firstname of the user. If I switch the sql statement around for example have username and email before first name it then does not insert the password switches name and email. Does anyone know how to fix this problem and have all of the information inserted into the proper tables in the database.
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<?php
$db_server = "server";
$db_username = "name";
$db_password = "pass";
$con = mysql_connect($db_server, $db_username, $db_password);if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$database = "Account_Holder";
$er = mysql_select_db($db_username);
if (!$er)
{
print ("Error - Could not select the database");
exit;
}
// table name
$tbl_name=Account_Holder;
// Random confirmation code
//$confirm_code=md5(uniqid(rand()));
// values sent from form
$firstName=$_POST['firstName'];
$email=$_POST['email'];
$password=$_POST['password'];
$username=$_POST['username'];
// Insert data into database
$sql="INSERT INTO $tbl_name(firstname, username, email, password)VALUES('$firstname', '$username', '$email', '$password')";
$result=mysql_query($sql);
echo "You have been added to the database! You may now log on using your username."
?>
<a href ="login.html"> Login Page </a>
</body>
</html>