<?php

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

$query = mysql_query("SELECT SupID, SupNum FROM ksupplier ORDER BY SupNum DESC LIMIT 1");

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

$index = ++$one[1];
$SupNum = $index;

if($index < 1000)
{
	$index = "Sup".$index;
}


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