Home  >  Article  >  Backend Development  >  mysqli 下一个 Auto_increment ID 怎么获取

mysqli 下一个 Auto_increment ID 怎么获取

WBOY
WBOYOriginal
2016-06-23 13:22:49935browse

注意是mysqli,不是mysql

现在用这样种都不行:

		$query="show table status like '{$tpre}{$table}'";	$sql=$xingao->query($query);	$id= mysqli_result($sql, 0, 'Auto_increment');//下一条ID		$query="show table status like '{$tpre}{$table}'";	$sql=$xingao->query($query);	$id= mysql_result($sql, 0, 'Auto_increment');//下一条ID


回复讨论(解决方案)

我是小白,我只知道先insert进去一条数据,然后再根据插入的数据select出来它的自增id

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn