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

$query = mysql_query("SELECT TID, TNum FROM stocktran ORDER BY TNum DESC LIMIT 1");


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

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



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