如果照你说的,那么MYSQL这个功能就显的没有必要了!

解决方案 »

  1.   

    to cpublic (CoCo) :不能这样的,mysql是取得记录最大值,然后才累加的,若是按你所说,mysql就很智能了,呵呵
      

  2.   

    应该不能,id山除了就是删除了。自动增加的id保证唯一性。
      

  3.   

    请用 ALTER TABLE  XXXXX AUTO_INCREMENT=0
    将计数器AUTO_INCREMENT_COUNT重置于0
    原理:
    插入记录时,AUTO值为
    MAX(AUTO_INCREMENT_COUNT, MAX(AUTO_INCREMENT_FIELD))+1
      

  4.   

    抄别人的,不知对你有没有帮助。<html>
    <head>
    <title>访客计数器 原型</title>
    </head>
    <body>
    <?php
    /*
    simple access counter for php3
    (c)1998 David W. Bettis
    [email protected]
    medify by Wilson Peng
    */$counterFile =  "/tmp/counter";function displayCounter($counterFile) {
      $fp     = fopen($counterFile,"rw");
      $num    = fgets($fp,5);
      $num    += 1;
      print  "您是第 "."$num"." 位无聊份子";
      exec( "rm -rf $counterFile");
      exec( "echo $num > $counterFile");
    }if (!file_exists($counterFile)) {
      exec( "echo 0 > $counterFile");
    }displayCounter($counterFile);?>
    </body>
    </html>