Skip to content

다음에 생성될 auto_increment 컬럼의 값 알아내기

MintState November 10, 2008 at 1:26 PM Views 15748

다음에 생성될 auto_increment 컬럼의 값 알아내기

테이블이름을 인자로 넣어주면...
다음에 생성될 auto_increment 컬럼의 값이 리턴 됩니다.

$변수 = get_autoinc("테이블이름");

function get_autoinc($table) 
{ 
	global $connect; 
	$data=mysql_fetch_array(mysql_query("show table status like '$table'")); 
	return $data[Auto_increment]; 
}

바로 입력된 auto_increment 컬럼 값

$no = mysql_insert_id();
Share X Facebook LINE QR code

0 comments

Be the first to comment.