获取下一个自动增量 [英] Get next auto increment

查看:70
本文介绍了获取下一个自动增量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这并不复杂,但是我不记得该怎么做.

I know this isn't so complicated but I can't remember how to do.

我只需要知道下一个自动增量即可.

I just need to know the next auto increment.

$result = mysql_query("
    SHOW TABLE STATUS LIKE Media
");
$data = mysql_fetch_assoc($result);
$next_increment = $data['Auto_increment'];

...但是我不会为我工作,我在做什么错了?

...but i won't work for me, what am I doing wrong?

推荐答案

$result = mysql_query("
    SHOW TABLE STATUS LIKE 'Media'
");
$data = mysql_fetch_assoc($result);
$next_increment = $data['Auto_increment'];

表名需要用单引号引起来,如下所示:'table_name'

The name of the table needed to be wrapped with single quotes like this: 'table_name'

所以它现在可以正常工作了.

So it works just fine now.

:)

这篇关于获取下一个自动增量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆