<?php

	$user4 =$_GET['user4'];
	$Name=$_POST["Name"];
	$Email=$_POST["Email"];
	$Phone=$_POST["Phone"];
	$HPhone=$_POST["HPhone"];
	$Gender=$_POST["sex"];
	$Address1=$_POST["Address1"];
	$Postcode=$_POST["Postcode"];
	$IC=$_POST["IC"];
	$BYear=$_POST["BYear"];
	$BMonth=$_POST["BMonth"];
	$BDay=$_POST["BDay"];
	
	echo $user4;

	$login=mysql_connect('localhost', 'wauhaha_karaoke', 'cross123','wauhaha_karaoke');
	
	mysql_selectDB("wauhaha_karaoke",$login);
	
	$query=mysql_query("SELECT * from regmember where Username='$user4'");


$query2=mysql_query("UPDATE regmember SET Name = '$Name',
Gender='$Gender',
BYear ='$BYear',
BMonth ='$BMonth',
BDay ='$BDay',
Address1 ='$Address1',
Postcode ='$Postcode',
IC ='$IC',
Email = '$Email',
Phone = '$Phone',
HPhone = '$HPhone'
WHERE Username='$user4'");
if($query2){
	echo "<script language=javascript>alert('Update successful!!');window.location='http://www.wauhaha.com/karaoke/memaccdetail.php?user2=$user4'</script>";
}
echo "<script language=javascript>alert('Update fail!!');window.location='http://www.wauhaha.com/karaoke/memaccdetail.php?user2=$user4'</script>";
	
	?>