来看具体的实现过程。
1、创建所需的数据库与表。
mysql> create database counter;
Query OK, 1 row affected (0.10 sec)
mysql> use counter;
Database changed
mysql> create table tl(id integer(2),count integer(5));
Query OK, 0 rows affected (0.21 sec)
mysql> show columns from tl;
+-------+--------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+--------+------+-----+---------+-------+
| id | int(2) | YES | | NULL | |
| count | int(5) | YES | | NULL | |
+-------+--------+------+-----+---------+-------+
2 rows in set (0.05 sec)
mysql> select * from tl;
Empty set (0.08 sec)
mysql> insert into tl(id,count) values(1,1);
Query OK, 1 row affected (0.02 sec)
mysql> select * from tl;
+------+-------+
| id | count |
+------+-------+
| 1 | 1 |
+------+-------+
1 row in set (0.03 sec)
2、html文件的内容。
您可能感兴趣的文章:
php计数器的简单例子
一个简单的php 文本计数器的代码
php 计数器(文本、图形计数器)代码