본문 바로가기

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

MintState 2008년 11월 10일 오후 1:26 조회 15747

다음에 생성될 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();
공유 X Facebook LINE QR 코드

댓글 0개

첫 댓글을 남겨보세요.