PHP-MySQL Insert Data problem
Hi Everyone,
I am using php-mysql, the problem is it can't insert the data into mysql after i have click submit button. The source code is like :
<?php
$db = mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("eBid",$db);
if($_GET["ActionMode"]=="register02"){
mysql_query("INSERT INTO registration (fname,username,Password,ic,address,state,city,pos talcode,phoneno,dob,Email,Gender,safety_question,a nswer) VALUES('".$_POST["fname"]."','".$_POST["username"]."','" .$_POST["Password"]. "','".$_POST["ic"]."','".$_POST['address']."','".$_POST['state']."','".$_POST["city"]."','".$_POST["postalcode"]."','".$_POST["areacode"].$_POST["number"]."','".$_POST["year"].$_POST["month"].$_POST["day"]."','" .$_POST["Email"]."','" .$_POST["Gender"]."','" .$_POST["safety_question"]."','" .$_POST["answer"]."')");
mysql_query("INSERT INTO login (username,Password,Status) VALUES ('".$_POST["username"]."','".$_POST["Password"]."','Inactive')");
mysql_query("COMMIT");
$success = "Register+Successfully";
$URL="message1.php?msg=$success";
header ("Location: $URL");
$Name = $_POST["username"];
$Password = $_POST["Password"];
}
mysql_close($db);
?>
|