Hello,
I posted a similar issue earlier - I fixed that issue that was throwing error messages and now my data from a form is being dumped to my table, well, most of it.
It is not recording the Username or Password fields and I have absolutely no idea why - There have been some changes made by another programmer and I am trying to unravel what they may have done. Originally, everything worked and was dumped into my table just fine.
Thank you for any help in advance!
<?php
define('DB_HOST', 'localhost');
define('DB_NAME', '******');
define('DB_USER','*******');
define('DB_PASSWORD','******');
$con=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD) or die("Failed to connect to MySQL: " . mysql_error());
$db=mysql_select_db(DB_NAME,$con) or die("Failed to connect to MySQL: " . mysql_error());
function NewUser()
{
$userName = $_POST['userName'];
$email = $_POST['email'];
$password = $_POST['password'];
$countries = $_POST ['countries'];
$city = $_POST['city'];
$company = $_POST ['company'];
$state = $_POST ['state'];//Added 11/3/2014
$query = "INSERT INTO Table3 (userName,email,password,countries,city,company,state) VALUES ('$userName','$email','$password', '$countries','$city','$company', '$state')";
$data = mysql_query ($query)or die(mysql_error());
if($data)
{
echo "YOUR REGISTRATION IS COMPLETED...";
}
}
function SignUp()
{
if(!empty($_POST['user'])) //checking the 'user' name which is from Sign-Up.html, is it empty or have some text
{
$query = mysql_query("SELECT * FROM Table3 WHERE userName = '$_POST[user]' AND password = '$_POST[password]'") or die(mysql_error());
if(!$row = mysql_fetch_array($query) or die(mysql_error()))
{
NewUser();
}
else
{
echo "SORRY...YOU ARE ALREADY REGISTERED USER...";
}
}
}
if(isset($_POST['user']))
{
SignUp();
}
?>