<?php
	$login=mysql_connect('localhost', 'wauhaha_karaoke', 'cross123','wauhaha_karaoke');
	
	mysql_selectDB("wauhaha_karaoke",$login);
		

$query = mysql_query("SELECT RID, RNum FROM roomtype ORDER BY RNum DESC LIMIT 1");


$row = mysql_fetch_array($query);
$RID = $row["RID"];
list($one[0],$one[1]) = split('RT',$RID);

$index = ++$one[1];
$RNum = $index;
if($index < 10)
{
	$index = "RT0".$index;
}



echo "<input type='hidden' name='RID' value='".$index."'><input type='hidden' name='RNum' value='".$RNum."'>".$index;
?>