<?php

$login=mysql_connect('localhost', 'wauhaha_karaoke', 'cross123','wauhaha_karaoke');
	
	mysql_selectDB("wauhaha_karaoke",$login);
$name = $_POST['name'];	
$p1 = $_POST['p1'];
$p2 = $_POST['p2'];
$RID = $_GET['RID'];




if((!is_numeric($p1))||(!is_numeric($p2))){
		echo "<script language='javascript'>alert('Input Must Be Numeric.')</script>";
		echo "<script language='javascript'>window.location='addrate.php?roomtype=$rt'</script>";die;
}
$query = mysql_query("Update roomtype Set roomtype='$name', price1='$p1',price2='$p2' where RID='$RID'");
if($query){

		echo "<script language='javascript'>alert('Adjust Successful.')</script>";
		echo "<script language='javascript'>window.location='roomtype.php'</script>";

}else

		echo "<script language='javascript'>alert('Adjust Fail.')</script>";
		echo "<script language='javascript'>window.location='addrate.php?roomtype=$rt'</script>";
