ค้นหาค่า auto_increment ของ table ด้วย MDB2

        $sql = "SHOW TABLE STATUS LIKE 'table_name'";
        $res = $mdb2->query($sql);
        if (PEAR::isError($res)) {
            die($res->getMessage());
        }
        $result = $res->fetchRow();
        $next_id = $result['auto_increment'];

Leave a Reply

Your email address will not be published. Required fields are marked *